[R-SIG-Finance] "Next" in quantmod
Jeff Ryan
jeff.a.ryan at gmail.com
Wed May 13 19:57:11 CEST 2009
A bug. :)
It is fixed on R-forge, and will be headed to CRAN soon.
> install.packages("quantmod", repos="http://r-forge.r-project.org")
trying URL 'http://r-forge.r-project.org/src/contrib/quantmod_0.3-9.tar.gz'
Content type 'application/x-gzip' length 100132 bytes (97 Kb)
opened URL
==================================================
downloaded 97 Kb
* Installing *source* package 'quantmod' ...
** R
** demo
....
> library(quantmod)
> getSymbols("CSCO")
[1] "CSCO"
> head(Next(Cl(CSCO)))
Next
2007-01-03 28.46
2007-01-04 28.47
2007-01-05 28.63
2007-01-08 28.47
2007-01-09 28.68
2007-01-10 28.69
Thanks,
Jeff
On Wed, May 13, 2009 at 12:50 PM, Steve Wisdom <swisdom at gmail.com> wrote:
> Not sure is this is a bug, or a feature, or just a brain-cramp on my end:
>
>> require(quantmod)
> Loading required package: quantmod
> Loading required package: xts
> Loading required package: zoo
>
> Attaching package: 'zoo'
>
> The following object(s) are masked from package:base :
>
> as.Date.numeric
>
> Loading required package: Defaults
> quantmod: Quantitative Financial Modelling Framework
>
> Version 0.3-7, Revision 461
> http://www.quantmod.com
>
>> getSymbols("CSCO")
> [1] "CSCO"
>> head(Lag(Cl(CSCO)))
> Lag.1
> 2007-01-03 NA
> 2007-01-04 27.73
> 2007-01-05 28.46
> 2007-01-08 28.47
> 2007-01-09 28.63
> 2007-01-10 28.47
>> head(Next(Cl(CSCO))) <--------------
> Error in `[.xts`(x, -(0:k), ) :
> only zeros may be mixed with negative subscripts
>> R.version.string
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
--
Jeffrey Ryan
jeffrey.ryan at insightalgo.com
ia: insight algorithmics
www.insightalgo.com
More information about the R-SIG-Finance
mailing list