[R] Downloading data from Economagic

Gabor Grothendieck ggrothendieck at gmail.com
Tue Dec 30 15:52:20 CET 2008


Try this (last line only needed if you want times as Date class):

library(zoo)
z <- zoo(as.matrix(dat2), time(dat2))
time(z) <- as.Date(time(z)) # optional


or you can use as.zoo.timeSeries from the devel version of zoo:

source("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/as.zoo.R?rev=557&root=zoo")
z <- as.zoo(dat2)
time(z) <- as.Date(time(z)) # optional



On Tue, Dec 30, 2008 at 6:25 AM, RON70 <ron_michael70 at yahoo.com> wrote:
>
> Oh my mistake, I missed the argument nDaysBack = 366.
>
> However pls let me know how to change the data to zoo object.
>
>
> RON70 wrote:
>>
>> I was trying to dw data from Economagic
>> [http://www.economagic.com/em-cgi/data.exe/libor/day-ussnon], using
>> following code :
>>
>> library(fimport)
>> dat2 = economagicSeries("libor/day-ussnon", frequency = "daily")
>>
>> Here I see that data is not complete, downloaded data starts from
>> "2007-12-31 ", whereas actual data is available from 2001.
>>
>> secondly, how I convert that data to a Zoo-object?
>>
>
> --
> View this message in context: http://www.nabble.com/Downloading-data-from-Economagic-tp21215913p21215929.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