Skip to content

Instantly share code, notes, and snippets.

@sckott
Created February 24, 2014 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sckott/9197940 to your computer and use it in GitHub Desktop.
Save sckott/9197940 to your computer and use it in GitHub Desktop.
install_github("ropengov/rsunlight")
library(rsunlight)
dream <- lapply(c('D','R'), function(x) cw_timeseries(phrase='i have a dream', party=x, start_date='1996-01-01', end_date='2013-01-01', granularity='month'))
df <- merge(dream[[1]], dream[[2]], by='month', all=TRUE)
df[is.na(df)] <- 0
names(df) <- c('date','D','R')
df$date <- as.character(df$date)
library(rCharts)
m1 <- mPlot(x = "date", y = c("D", "R"), type = "Line", data = df)
m1$set(pointSize = 0, lineWidth = 1)
m1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment