Skip to content

Instantly share code, notes, and snippets.

@sckott
Created April 4, 2014 00:01
Show Gist options
  • Save sckott/9965340 to your computer and use it in GitHub Desktop.
Save sckott/9965340 to your computer and use it in GitHub Desktop.
install_github("ropengov/rsunlight")
library("ropengov")
dream <- lapply(c('D','R'), function(x) cw_timeseries(phrase='climate change', party=x,
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
m1$publish("My Chart", host = 'rpubs') # publish to rpubs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment