Skip to content

PerformanceAnalytics - Error in UseMethod("time<-")

6 messages · Heiko Mayer, Jeff Ryan, Gabor Grothendieck

#
Hi,

I have tried to create the PerformanceSummary chart in PerformanceAnalytics but always got an error. Even the example doesn't work showing the same error. I only get german error messages, but in english it should look like:
'Error in UseMethod("time<-") : no applicable method for "time<-"'
Fehler in UseMethod("time<-") : keine anwendbare Methode f?r "time<-"
 
Has anyone an idea?

Thanks,
Heiko
#
For PerformanceAnalytics time<- is being defined in the zoo package.

You haven't included your sessionInfo, so beyond that it's not  
possible to see where the actual problem is.

Please post the all the requested info so we can see where conflicts/ 
issues are occurring.  My guess is a conflict in the use of time from  
another package.

Jeff

Jeffrey A. Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com
On Jul 11, 2009, at 9:28 AM, "Heiko Mayer" <Heiko-Mayer at gmx.de> wrote:

            
#
Always state what commands you are using so that others
can reproduce the problem.    I suspect there is something
wrong with your setup as this works for me:

library(PerformanceAnalytics)
example(charts.PerformanceSummary)
[1] "0.9.7.1"
[1] "R version 2.9.1 Patched (2009-07-01 r48886)"
may not be present.  Make sure its installed and loaded.

search()

should list zoo.
On Sat, Jul 11, 2009 at 10:28 AM, Heiko Mayer<Heiko-Mayer at gmx.de> wrote:
#
Thank you all for the feedback. I was able to replicate the error and I know when it occurs, but have no clue why.
I have installed the latest R version (2.9.1) and libraries PerformanceAnalytics and zoo. Under that environment, "charts.PerformanceSummary" worked. 
However, after installing Rmetrics packages according to "https://wiki.rmetrics.org/install_rmetrics"
   source("http://www.rmetrics.org/Rmetrics.R")
   install.Rmetrics()
it doesn't work anymore when you load library "fPortfolio" (in addition to PerformanceAnalytics and zoo).
Does anyone experienced problems with fPortfolio before?

Below please find the sessionInfo:
R version 2.9.1 (2009-06-26) 
i386-pc-mingw32 

locale:
LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] fPortfolio_2100.77           Rsymphony_0.1-9              Rglpk_0.3-1                  slam_0.1-1                   quadprog_1.4-11             
 [6] fAssets_2100.77              robustbase_0.4-5             fCopulae_2100.76             adapt_1.0-4                  sn_0.4-12                   
[11] mnormt_1.3-3                 fBasics_2100.77              timeSeries_2100.83           timeDate_290.85              MASS_7.2-47                 
[16] PerformanceAnalytics_0.9.7.1 zoo_1.5-6                   

loaded via a namespace (and not attached):
[1] grid_2.9.1      lattice_0.17-25 tools_2.9.1    

Thank you,
Heiko


-------- Original-Nachricht --------

  
    
#
This seems to cause the problem:

library(PerformanceAnalytics)
library(fPortfolio)
example(charts.PerformanceSummary)

whereas this works (same statements different order):

library(fPortfolio)
library(PerformanceAnalytics)
example(charts.PerformanceSummary)

It appears that fPortfolio or one of the associated rmetrics packages
is masking time<-.zoo.  I suspect an S4 problem either with S4 itself
or with the implementation in rmetrics.

At any rate the workaround seems to be to load PerformanceAnalytics
after fPortfolio rather than before.
[1] "0.9.7.1"
[1] "R version 2.9.1 Patched (2009-07-01 r48886)"
[1] "2100.77"


On Sat, Jul 11, 2009 at 12:39 PM, Gabor
Grothendieck<ggrothendieck at gmail.com> wrote:
#
Gabor,

Thank you very much. That quick fix works excellent. I will cc Rmetrics, maybe they can have a look at it.

Regards,
Heiko

-------- Original-Nachricht --------