[R] How to view the code of a method?

Stefano Calza stef at biostatistics.it
Tue Oct 2 17:05:54 CEST 2007

For S3 methods I'd try something like


 [1] predict.ar*                predict.Arima*             predict.arima0*            predict.glm               
 [5] predict.HoltWinters*       predict.lm                 predict.loess*             predict.mlm               
 [9] predict.nls*               predict.poly               predict.ppr*               predict.prcomp*           
[13] predict.princomp*          predict.smooth.spline*     predict.smooth.spline.fit* predict.StructTS*         

   Non-visible functions are asterisked

and then e.g.




for those Non-visible



On Tue, Oct 02, 2007 at 11:52:34PM +0900, Strong wrote:
<Strong>Dear All 
<Strong>I am a biginner of R.
<Strong>I have difficulty with reading the code of a method.   
<Strong>I am using the vars package to estimate a VAR model and I want to view the code of "predict" method for objects with class attribute "varest". 
<Strong>I thougt I could just type the name "predict" without anything to display the code of the method as I often do with generic function. However, I got the following messages:
<Strong>function (object, ...) 
<Strong><environment: namespace:stats>
<Strong>I cannot figure out the meaning that the above message want to deliver to me and thus cannot find a way to view the code of the predict method with class varest. 
<Strong>Can anyone help me out?
<Strong>Thanks in advance.  
<Strong>Strong Chen
<Strong>R-help a r-project.org mailing list
<Strong>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
<Strong>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list