[R] Using getSymbols

Gabor Grothendieck ggrothendieck at gmail.com
Tue Feb 3 10:28:34 CET 2009


xts has a bracket notation like this:

u <- getSymbols("PPIACO", src="FRED", verbose=TRUE, auto.assign=FALSE)
u["1970::"]

and zoo uses window just like ts does:

z <- as.zoo(u)
window(z, start = "1970-01-01")


On Mon, Feb 2, 2009 at 11:58 PM, Shruthi Jayaram
<shruthi.jayaram.85 at gmail.com> wrote:
>
> Hi,
>
> How can one ask getSymbols to obtain data within a specified time interval?
> For example, if I am downloading US PPI data:
>
> usppi <- as.zoo(getSymbols("PPIACO", src="FRED", verbose=TRUE,
> auto.assign=FALSE))
>
> How do I ask getSymbols to truncate starting from Jan-1970 until present? I
> looked up the help file but couldn't find anything.
>
> Another newbie question, can I specify the frequency of the data I want from
> FRED? The USPPI data above gives me monthly data, is there a way I can ask
> to obtain annual data?
>
> Thanks very much, I'd be grateful for any help on this.
>
> Shruthi
> --
> View this message in context: http://www.nabble.com/Using-getSymbols-tp21803950p21803950.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list