Skip to content

Instantly share code, notes, and snippets.

@qoelet
Created December 7, 2013 09:09
Show Gist options
  • Save qoelet/7838881 to your computer and use it in GitHub Desktop.
Save qoelet/7838881 to your computer and use it in GitHub Desktop.
# Reload data from list via Quandl
watchSymbols <- c(
"GOOG/NYSE_TWTR",
"GOOG/NASDAQ_FB"
)
watchNames <- c(
"twitter",
"facebook"
)
# merge to nx2
watchList <- cbind(watchNames, watchSymbols)
# assume API token is saved as variable 'q_token' in the current global env
library(Quandl)
Quandl.auth(q_token)
# function to iterate through watchList
reload_data <- function( wl ) {
for( ridx in 1:nrow(wl) ) {
df <- Quandl( watchList[ridx,][["watchSymbols"]] )
df <- reverse_df( df )
assign( watchList[ridx,][["watchNames"]], df, envir=.GlobalEnv )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment