« Large scale optimization with optim() and RevoScaleR | Main | A new paper and new(ish) R packages »

January 09, 2014

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

This is a very nice post to highlight the great xts package by Jeff Ryan and Josh Ulrich. Above, Joseph mentioned that xts objects behave much like data.frames in terms of subsetting etc. It is important to know that the data in an xts object is actually stored in a matrix, not a data.frame. The xts object does not support data in a data.frame and any attempt to do so will result in the data.frame being converted into a matrix. So if you have mixed data types in a data.frame x.df (e.g. character data and numeric data) and you create an xts object using the xts() constructor function with x.df as the data then the resulting xts object will have its data as a character matrix (which you can confirm using class(coredata(my.xts))).

Thanks for the informative post. Using

options(digits=6)

makes the final output more useful.

If I make a script out of the code above, to get data for QQQ instead of SPY, I need to replace "SPY" with "QQQ" in many places, instead of one, which would be better. This occurs because, as the post states, "the return object from getSymbols is assigned the name of the ticker symbol, in this case SPY." How can the code be made more generic so that it works for any ticker symbol?

Good tutorial, but there is something very weird from this outlet.

In last post You wrote "One of the limitations of data available from Yahoo and Google, as may be noticed above, is that it only dates back to January of 2007,"

and based on that instructed users to use futures data instead which is "common in these situations", which they can get at Quandl

yet in this tutorial You claim "getSymbols("SPY", src="google", from = "2004-01-01")"

Lately there is so much hustle-peddling of Quandl in data community that besides its goodness is really nothing special, and You lower Yourself in eyes of people who are actually very familiar with these matters.

The comments to this entry are closed.


R for the Enterprise

Got comments or suggestions for the blog editor?
Email David Smith.
Follow revodavid on Twitter Follow David on Twitter: @revodavid

Search Revolutions Blog