CALEF ALEJANDRO RODRIGUEZ CUEVAS
2010-Dec-29 20:31 UTC
[R] Trying to extract an algorithm from a function
Hi, I'm using package "vars" and I'm trying to extract the algorithm that function "predict" contained in that package in order to understand how does it work. When I type function "VAR" then all its algorithm appears in R, however if I try to do the same with "predict" nothing happens...Is there any possible way to extract the algorithm? Thanks a lot. Regards [[alternative HTML version deleted]]
On Dec 29, 2010, at 3:31 PM, CALEF ALEJANDRO RODRIGUEZ CUEVAS wrote:> Hi, I'm using package "vars" and I'm trying to extract the algorithm > that > function "predict" contained in that package in order to understand > how does > it work. > > When I type function "VAR" then all its algorithm appears in R, > however if I > try to do the same with "predict" nothing happens...Is there any > possible > way to extract the algorithm?With the package loaded do this to an object to which you are submitting to predict class(object) Then do" methods(predict) If your <class>.predict function has a "*" by it then do this: getAnywhere(<class>.predict) And if you are using a package that uses S4 methods, good luck. -- David Winsemius, MD West Hartford, CT
vars:::predict.vec2var vars:::predict.varest On 12/29/2010 9:31 PM, CALEF ALEJANDRO RODRIGUEZ CUEVAS wrote:> Hi, I'm using package "vars" and I'm trying to extract the algorithm that > function "predict" contained in that package in order to understand how does > it work. > > When I type function "VAR" then all its algorithm appears in R, however if I > try to do the same with "predict" nothing happens...Is there any possible > way to extract the algorithm? > > Thanks a lot. > > Regards > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >