[R-SIG-Finance] RMetrics fBasics market data retrieval andtimeSeries functionality still being maintained at all?
Martin Maechler
maechler at stat.math.ethz.ch
Wed Aug 15 15:42:39 CEST 2007
>>>>> "DL" == David-Michael Lincke <dlincke at lincke.net>
>>>>> on Tue, 14 Aug 2007 13:49:31 -0400 writes:
DL> Thanks everybody for pointing this out. I did not expect updates to the
DL> packages to be dependent on the very latest release of R being installed
DL> given that my installation is still less then a year old.
They do depend only as long as you use Windoze and install
precompiled aka "binary" R packages.
Precompiled R packages are typically only available for the
latest version of R.
If you'd either use a real operating system or install all the
necessary tools on windows (beware!! that's not at all easy, and
many people have given up trying to do that) such that you can
install *source* (as opposed to "binary") R packages on windows,
you would not see such problems.
Regards,
Martin
DL> -----Original Message-----
DL> From: Dirk Eddelbuettel [mailto:edd at debian.org]
DL> Sent: Tuesday, August 14, 2007 1:31 PM
DL> To: David-Michael Lincke
DL> Cc: 'Martin Maechler'; r-sig-finance at stat.math.ethz.ch
DL> Subject: Re: [R-SIG-Finance] RMetrics fBasics market data retrieval
DL> andtimeSeries functionality still being maintained at all?
DL> On 14 August 2007 at 12:22, David-Michael Lincke wrote:
DL> | Martin,
DL> |
DL> | I did run update.packages() after I first encountered problems, which
DL> | suggested that no newer version was available. The source code of
DL> | yahooImport() clearly scans for dates with format along the lines of
DL> | 2007-Aug-01 while Yahoo actually delivers 2007-08-01. Here is the output
DL> | from sessionInfo():
DL> |
DL> | > sessionInfo()
DL> | R version 2.4.0 (2006-10-03)
DL> | i386-pc-mingw32
DL> Released last October, as the date shows. You missed a patch release (always
DL> recommended), a new major release (2.5.) and its first patch releases.
DL> | locale:
DL> | LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
DL> | States.1252;LC_MONETARY=English_United
DL> | States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
DL> |
DL> | attached base packages:
DL> | [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets"
DL> | [7] "base"
DL> |
DL> | other attached packages:
DL> | fBasics fCalendar fEcofin MASS
DL> | "240.10068.1" "240.10068" "240.10067" "7.2-34"
DL> These are __current only conditional of the version of R you're running__
DL> i.e. R found you the max(version | R release). The problem is that you use
DL> an outdated R releases, which leads to the outdated Rmetrics.
DL> Please upgrade, and your problem should go away as suggested by three
DL> different readers of this list.
DL> Hth, Dirk
DL> | David
DL> |
DL> | -----Original Message-----
DL> | From: Martin Maechler [mailto:maechler at stat.math.ethz.ch]
DL> | Sent: Tuesday, August 14, 2007 12:03 PM
DL> | To: David-Michael Lincke
DL> | Cc: 'Diethelm Wuertz'; r-sig-finance at stat.math.ethz.ch
DL> | Subject: Re: [R-SIG-Finance] RMetrics fBasics market data retrieval and
DL> | timeSeries functionality still being maintained at all?
DL> |
DL> |
DL> | >>>>> "DL" == David-Michael Lincke <dlincke at lincke.net>
DL> | >>>>> on Sun, 12 Aug 2007 21:11:39 -0400 writes:
DL> |
DL> | DL> Diethelm,
DL> | DL> Thank you for your response. Asyt.ts in my example is a timeSeries
DL> | object
DL> | DL> constructed using yahooSeries(). Trying out the example you
DL> provided
DL> | I get:
DL> |
DL> | >> IBM = yahooSeries("IBM")
DL> | DL> trying URL
DL> | DL>
DL> |
DL> 'http://chart.yahoo.com/table.csv?s=IBM&a=7&b=12&c=2006&d=7&e=12&f=2007&g=d&
DL> | DL> x=.csv'
DL> | DL> Content type 'text/csv' length unknown
DL> | DL> opened URL
DL> | DL> downloaded 12Kb
DL> |
DL> | DL> Read 250 items
DL> | DL> Error in matrix(unlist(x2), byrow = TRUE, nrow = length(x2)) :
DL> | DL> matrix: invalid 'ncol' value (< 0)
DL> | DL> Error in .yahooSeries(symbols[1], from = from, to = to, nDaysBack
DL> =
DL> | DL> nDaysBack, :
DL> | DL> cannot get a slot ("data") from an object of type "character"
DL> |
DL> | David,
DL> | I can confirm Diethelm's statement that yahooSeries()
DL> | works without problems
DL> |
DL> | __IFF__ you use current versions of R and fBasics.
DL> |
DL> | Can you give your
DL> | sessionInfo() ## {after having loaded fBasics} ?
DL> |
DL> | I'm pretty sure your version of fBasics is not current enough.
DL> |
DL> | DL> After applying the patch to yahooImport() that I posted in my
DL> | initial
DL> | DL> message the import works:
DL> |
DL> | >> IBM = yahooSeries("IBM")
DL> | DL> trying URL
DL> | DL>
DL> |
DL> 'http://chart.yahoo.com/table.csv?s=IBM&a=7&b=12&c=2006&d=7&e=12&f=2007&g=d&
DL> | DL> x=.csv'
DL> | DL> Content type 'text/csv' length unknown
DL> | DL> opened URL
DL> | DL> downloaded 12Kb
DL> |
DL> | DL> Read 250 items
DL> | DL> Read 7 items
DL> |
DL> | >> colnames(IBM)
DL> | DL> [1] "IBM.Open" "IBM.High" "IBM.Low" "IBM.Close"
DL> "IBM.Volume"
DL> |
DL> | DL> Given that plot() has been overloaded to deal with timeSeries
DL> | objects I
DL> | DL> would have expected it to have some default functionality when
DL> | passed a
DL> | DL> timeSeries object short of unceremoniously failing in a lower
DL> level
DL> | function
DL> | DL> call. I did not realize it only works on single columns/data
DL> series.
DL> |
DL> | DL> As for ohlcDailyPlot(), I checked the source code later on and
DL> | realized that
DL> | DL> it expects column names that are different from how the market
DL> data
DL> | DL> retrieval functions construct their timeSeries objects. This is
DL> | easily
DL> | DL> adjusted for. However, it's not exactly a smooth solution from a
DL> | design
DL> | DL> point of view. Also, the documentation does not mention the need
DL> for
DL> | an
DL> | DL> explicit prior call to par(mfrow = c(2, 1)) for it to result in a
DL> | proper
DL> | DL> plot. But I guess maybe that's obvious to a more seasoned R user
DL> | than me.
DL> |
DL> | DL> Anyway, thank you for pointing me in the right direction. The code
DL> | in
DL> | DL> yahooImport(), however, really is broken as you can clearly verify
DL> | by taking
DL> | DL> a look at the date format delivered by Yahoo which does not have
DL> | spelled out
DL> | DL> three letter month names as expected by the source code.
DL> |
DL> |
DL> | I partly agree with you, that the documentation of several of
DL> | the Rmetrics functions is clearly "sub-optimal".
DL> | There's currently an ongoing effort to make Rmetrics being
DL> | loaded on more shoulders than just Diethelm's and I'd hope that
DL> | consequently many things will improve on the documentation front
DL> | ...
DL> |
DL> | Best regards,
DL> | Martin
DL> |
DL> | DL> David
DL> |
DL> | _______________________________________________
DL> | R-SIG-Finance at stat.math.ethz.ch mailing list
DL> | https://stat.ethz.ch/mailman/listinfo/r-sig-finance
DL> | -- Subscriber-posting only.
DL> | -- If you want to post, subscribe first.
DL> --
DL> Three out of two people have difficulties with fractions.
DL> _______________________________________________
DL> R-SIG-Finance at stat.math.ethz.ch mailing list
DL> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
DL> -- Subscriber-posting only.
DL> -- If you want to post, subscribe first.
More information about the R-SIG-Finance
mailing list