[R-SIG-Finance] error with Return.rebalancing after upgrading to latest stable PerformanceAnalytics v1.1.0

Joshua Ulrich josh.m.ulrich at gmail.com
Fri Aug 9 18:41:34 CEST 2013


Your example doesn't run because you sent HTML mail even though you're
explicitly told not to in the posting guide:
http://www.r-project.org/posting-guide.html

Please send a reproducible example in *plain text*.

Also, please do not cross-post:
http://lists.r-forge.r-project.org/pipermail/returnanalytics-commits/2013-August/000849.html

--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com


On Fri, Aug 9, 2013 at 11:32 AM, Paolo Cavatore <pcavatore at gmail.com> wrote:
> I have a problem with Return.rebalancing() from PerformanceAnalytics after
> upgrading to the latest stable release v1.1.0.
>
> The below simple example was working wth previous versions but now returns
> the following error message...
>
>
> require(PerformanceAnalytics)
>
> testRet <- xts(cbind(c(0.10,-0.08,0.15), c(0.02,0.01,-0.01)), order.by
> =as.Date(c("2013-07-**19","2013-07-26","2013-08-02")**) )
> names(testRet) <- c("equity", "bond")
>
> testWeights <- xts(cbind(c(0.2,0.3), c(0.8,0.7)), order.by
> =as.Date(c("2013-07-**19","2013-07-26")) )
> names(testWeights) <- c("equity", "bond")
>
> Return.rebalancing(testRet,**testWeights)
> sessionInfo()
>
> ####################
>> require(PerformanceAnalytics)
>>
>> testRet <- xts(cbind(c(0.10,-0.08,0.15), c(0.02,0.01,-0.01)), order.by=as.Date(c("2013-07-19","2013-07-26","2013-08-02"))
> )
>> names(testRet) <- c("equity", "bond")
>>
>> testWeights <- xts(cbind(c(0.2,0.3), c(0.8,0.7)), order.by=as.Date(c("2013-07-19","2013-07-26"))
> )
>> names(testWeights) <- c("equity", "bond")
>>
>> Return.rebalancing(testRet,testWeights)
> Error in `[.xts`(result, 2:length(result)) : subscript out of bounds
>>
>> sessionInfo()
> R version 3.0.1 (2013-05-16)
> Platform: i386-w64-mingw32/i386 (32-bit)
> locale:
> [1] LC_COLLATE=Italian_Switzerland.1252
> LC_CTYPE=Italian_Switzerland.1252    LC_MONETARY=Italian_Switzerland.1252
> [4] LC_NUMERIC=C
> LC_TIME=Italian_Switzerland.1252
> attached base packages:
> [1] stats     graphics  grDevices datasets  utils     methods   base
> other attached packages:
> [1] PerformanceAnalytics_1.1.0 xts_0.9-5
> zoo_1.7-10                 rcom_3.1-2
> rscproxy_2.0-5
> loaded via a namespace (and not attached):
> [1] grid_3.0.1      lattice_0.20-15 tools_3.0.1
>
> #######################
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list