Skip to content
Prev 4670 / 15274 Next

error in plot() with fGarch object from saved .RData file

BGP> On Windows, R saves your workspace automagically on quitting
   BGP> in a file
   BGP> in the working directory called .RData
   BGP>
   BGP> if I have a garchFit object 'gf' it will plot correctly
   BGP> immediately
   BGP> after fitting.
   BGP>
   BGP> However, it will fail after reloading:
   BGP>
   BGP> > plot(gf)
   BGP> Error in as.double(y) :
   BGP> cannot coerce type 'S4' to vector of type 'double'

Hi Brian,

I suspect that you did not load 'fGarch' before trying to plot your
saved object 'gf'. You are thus missing plot,fGARCH-method and related
functions.

If you do not want your coworker to load the whole package, you could
include the missing method and functions in the saved workspace.

HTH
Yohan