Skip to content
Prev 2685 / 15274 Next

quantmod, getSymbols, csv

Hi John,

getSymbols.csv is not very robust at this time.  What needs to be done
is a clean generalization of the call, for cases that can't be covered
(like the date in the 3rd col, and superfluous data in cols 1 and 4,
if I am reading your data correctly).

I suspect something to identify the timestamp column, and the columns
you would like to include would make this more useful.  The other
option is to create your own custom getSymbols.John function, so
getSymbols('FILE', src="John") would do exactly what you want.  Simply
adding the below in the appropriate places to the getSymbols.csv
source would be all that is required.

For now:

x <- read.csv('CREFglobeq.csv',header=TRUE)
x <- xts(matrix(x$price,dimnames=list(index(x),'price')),as.Date(x$date))

             price
1992-05-01 25.8429
1992-05-04 25.9774
1992-05-05 25.9964
1992-05-06 26.2335
1992-05-07 26.3368

xts can be replaced by zoo, or any other time-series constructor you like.

Jeff
On Thu, Jul 17, 2008 at 11:10 AM, John P. Burkett <burkett at uri.edu> wrote: