Skip to content
Prev 6809 / 15274 Next

Database for Historical Security Prices

[moderator: my earlier email was being held b/c of a mistake I made on 
my end with my email address, sorry for the re-post]

I personally use a mysql database here with the 'quantmod' package. See:

?getSymbols.MySQL for the nitty gritty details.

You could also just open a connection to mysql either directly or via 
ODBC and convert your time series into a data.frame and then use 
dbWriteTable(dbcon, "SymbolName", Symbol.df). Conversely, to read back 
into R, just use dbReadTable(dbcon, "SymbolName") and convert it into a 
xts time series.

?dbReadTable and ?dbWriteTable ... If your dataset only adds the new row 
everyday, when writing the table you could specify append=TRUE, 
overwrite=FALSE.

HTH,
C