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-tp21215913p21215913.html Sent from the R help mailing list archive at Nabble.com.
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.
Still it seems that it is not downloading data properly. For example observation for date "2008-12-09 " is missing :> tail(dat2, 30)2008-10-02 2008-10-06 2008-10-08 2008-10-16 2008-10-20 2008-10-21 2008-10-22 2008-10-24 2008-10-27 2008-10-29 2008-10-30 2.68125 2.36875 5.37500 1.93750 1.51250 1.28125 1.11875 1.28125 1.26875 1.14000 0.73125 2008-10-31 2008-11-07 2008-11-10 2008-11-12 2008-11-13 2008-11-14 2008-11-17 2008-11-18 2008-11-19 2008-11-20 2008-11-24 0.40625 0.33125 0.35000 0.38250 0.40000 0.41250 0.40000 0.40000 0.43750 0.44375 0.80625 2008-11-25 2008-11-26 2008-12-08 2008-12-10 2008-12-11 2008-12-12 2008-12-15 2008-12-16 0.93125 0.98750 0.18625 0.12500 0.11500 0.11875 0.11938 0.15938 Can anyone please tell me whether I missing something? 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-tp21215913p21216192.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
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. >
Thanks Gabor for your reply. However it seems that data is not downloaded properly. Please take a look on downloaded data :> tail(dat2, 20)GMT libor/day-ussnon 2008-11-25 0.93125 2008-11-26 0.98750 2008-11-28 NA 2008-12-01 1.08750 2008-12-02 NA 2008-12-03 0.88125 2008-12-04 0.51875 2008-12-05 NA 2008-12-08 0.18625 2008-12-09 NA 2008-12-10 NA 2008-12-11 NA 2008-12-12 0.11875 2008-12-15 0.11938 2008-12-16 NA 2008-12-17 0.13250 2008-12-18 NA 2008-12-19 0.11000 2008-12-22 NA 2008-12-23 0.11750 Data for 2008-12-22 is given as NA, whereas in the website it is 0?11375. Does anyone have a better idea on how to download data from Economagic more efficiently? Gabor Grothendieck wrote:> > 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. >> > > ______________________________________________ > 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. > >-- View this message in context: http://www.nabble.com/Downloading-data-from-Economagic-tp21215913p21239643.html Sent from the R help mailing list archive at Nabble.com.
I was only addressing the part about converting it to a zoo object. Contact the fImport maintainer directly to sort out problems with that package. On Thu, Jan 1, 2009 at 2:06 AM, RON70 <ron_michael70 at yahoo.com> wrote:> > Thanks Gabor for your reply. However it seems that data is not downloaded > properly. Please take a look on downloaded data : > >> tail(dat2, 20) > GMT > libor/day-ussnon > 2008-11-25 0.93125 > 2008-11-26 0.98750 > 2008-11-28 NA > 2008-12-01 1.08750 > 2008-12-02 NA > 2008-12-03 0.88125 > 2008-12-04 0.51875 > 2008-12-05 NA > 2008-12-08 0.18625 > 2008-12-09 NA > 2008-12-10 NA > 2008-12-11 NA > 2008-12-12 0.11875 > 2008-12-15 0.11938 > 2008-12-16 NA > 2008-12-17 0.13250 > 2008-12-18 NA > 2008-12-19 0.11000 > 2008-12-22 NA > 2008-12-23 0.11750 > > Data for 2008-12-22 is given as NA, whereas in the website it is 0?11375. > Does anyone have a better idea on how to download data from Economagic more > efficiently? > > > > > Gabor Grothendieck wrote: >> >> 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. >>> >> >> ______________________________________________ >> 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. >> >> > > -- > View this message in context: http://www.nabble.com/Downloading-data-from-Economagic-tp21215913p21239643.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. >