Created
December 7, 2013 09:09
-
-
Save qoelet/7838881 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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