This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<!-- saved from url=(0063)http://localhost:34035/custom/googleVis/TableID2f62c93544c.html --> | |
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>TableID2f62c93544c</title> | |
<style type="text/css"> | |
body { | |
color: #444444; | |
font-family: Arial,Helvetica,sans-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Useful lubridate function for date subtraction written by mmparker | |
# Calculate age at a given reference date | |
# Create an interval between the date of birth and the enrollment date; | |
# intervals are specific to the two dates. Periods give the actual length | |
# of time between those dates, so convert to period and extract the year. | |
calc_age <- function(birthDate, refDate = Sys.Date()) { | |
require(lubridate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'mail' | |
#### THIS RUBY SCRIPT WAS ORIGINALLY POSTED BY blazeeboy ON GITHUB | |
mysql_username = 'root' | |
mysql_password = '123456' | |
mysql_database = 'test' | |
system("mysqldump --user=#{mysql_username} --password=#{mysql_password} #{mysql_database} > backup.sql") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample R script for finding winners in a proportional election system | |
# by Sharon Machlis | |
# This example assumes a spreadsheet with a list of candidates with column headers | |
# Municipality, Party, Place, Name, Variable | |
# and a spreadsheet with a list of results with column headers | |
# Municipality, Red, Blue, Green (Red, Blue, Green being sample political party names) | |
# See sample spreadsheet format at | |
# https://onedrive.live.com/redir?resid=7DDBA42BF10D288B!662&authkey=!AAFnW1H3wGiZgQU&ithint=file%2c.xlsx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# testGraph | |
test <- dPlot( | |
mpg ~ cyl, | |
data = mtcars, | |
type = 'bubble', | |
width=1000, | |
height=600 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Dimple Tooltip Test" | |
author: "Sharon Machlis" | |
date: "November 11, 2014" | |
output: html_document | |
--- | |
```{r, echo=FALSE} | |
load("testObject.Rda") | |
suppressPackageStartupMessages(library(rCharts)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
R version 3.0.2 (2013-09-25) | |
Platform: x86_64-apple-darwin10.8.0 (64-bit) | |
locale: | |
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 | |
attached base packages: | |
[1] splines tcltk stats graphics grDevices utils datasets methods base | |
other attached packages: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("jsonlite", dependencies = TRUE) | |
install.packages("RCurl", dependencies = TRUE) | |
library("jsonlite") | |
library("RCurl") | |
base_url <- "https://api.parsely.com/v2" | |
apikey <- "computerworld.com" | |
api_secret <- "YOUR SECRET KEY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function takes a correlation matrix from the cor() function and outputs a visualization. | |
# The corrplot package must be installed. | |
# This code comes from the R Graphics Cookbook by Winston Chang | |
corrviz <- function(mycorrmatrix){ | |
col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA")) | |
corrplot::corrplot(mycorrmatrix, method="shade", shade.col=NA, tl.col="black", tl.srt=45, col=col(200), addCoef.col="black") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url <- "http://forecast.weather.gov/MapClick.php?lat=33.74899931200048&lon=-84.38797796399967&site=all&smap=1#.VPUbWfnF9EI" | |
library(rvest) | |
html <- html(url) | |
forecasthtml <- html_nodes(html, ".row-forecast") | |
forecast <- html_text(forecasthtml) | |
# Note: to deal with the lack of spaces now between Today, Tonight, etc. and the start of the forecasts, I added | |
forecast_formatted <- gsub("day([A-Z])", "day \\1", forecast) | |
forecast_formatted <- gsub("Night([A-Z])", "Night \\1", forecast_formatted) | |
forecast_formatted <- gsub("Tonight([A-Z])", "Tonight \\1", forecast_formatted) | |
forecast_formatted <- gsub("Afternoon([A-Z])", "Afternoon \\1", forecast_formatted) |
OlderNewer