Hi, How do I retrieve the var.test() function code? I had a similar problem once before with another function but getMethods() solved the problem then. Now I tried several combinations for var.test() without success. Regards benjamin -- Benjamin Otto Universitaetsklinikum Eppendorf Hamburg Institut fuer Klinische Chemie Martinistrasse 52 20246 Hamburg [[alternative HTML version deleted]]
I have found that you need this to see the stats package code getAnywhere(var.test.default) Jeff -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Benjamin Otto Sent: Tuesday, October 31, 2006 10:15 AM To: R-Help Subject: [R] getMethod(s) and var.test Hi, How do I retrieve the var.test() function code? I had a similar problem once before with another function but getMethods() solved the problem then. Now I tried several combinations for var.test() without success. Regards benjamin -- Benjamin Otto Universitaetsklinikum Eppendorf Hamburg Institut fuer Klinische Chemie Martinistrasse 52 20246 Hamburg [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch 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.
On second thought, sometimes you need the .default (as in your case and for t.test) but not always...for aov you just need getAnywhere(aov) Not sure why... It seems the best choices to get package code are 1. body() 2. methods() 3. methods("packagename","default") 4. methods("packagename","mod") 5. getAnywhere(packagename) 6. getAnywhere(packagename.default) Jeff -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Benjamin Otto Sent: Tuesday, October 31, 2006 10:15 AM To: R-Help Subject: [R] getMethod(s) and var.test Hi, How do I retrieve the var.test() function code? I had a similar problem once before with another function but getMethods() solved the problem then. Now I tried several combinations for var.test() without success. Regards benjamin -- Benjamin Otto Universitaetsklinikum Eppendorf Hamburg Institut fuer Klinische Chemie Martinistrasse 52 20246 Hamburg [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch 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.
you may try something like this: body.fun <- lapply(methods(var.test), get, envir = environment(var.test), mode = "function") names(body.fun) <- methods(var.test) body.fun I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Benjamin Otto" <b.otto at uke.uni-hamburg.de> To: "R-Help" <r-help at stat.math.ethz.ch> Sent: Tuesday, October 31, 2006 4:15 PM Subject: [R] getMethod(s) and var.test> Hi, > > > > How do I retrieve the var.test() function code? I had a similar > problem once > before with another function but getMethods() solved the problem > then. Now I > tried several combinations for var.test() without success. > > > > Regards > > > > benjamin > > > > -- > Benjamin Otto > Universitaetsklinikum Eppendorf Hamburg > Institut fuer Klinische Chemie > Martinistrasse 52 > 20246 Hamburg > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
Dimitris, I like your version better than the one-line commands such as methods(). It appears that your version gives ALL of the code. Jeff -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Dimitris Rizopoulos Sent: Tuesday, October 31, 2006 11:12 AM To: Benjamin Otto Cc: r-help at stat.math.ethz.ch Subject: Re: [R] getMethod(s) and var.test you may try something like this: body.fun <- lapply(methods(var.test), get, envir = environment(var.test), mode = "function") names(body.fun) <- methods(var.test) body.fun I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Benjamin Otto" <b.otto at uke.uni-hamburg.de> To: "R-Help" <r-help at stat.math.ethz.ch> Sent: Tuesday, October 31, 2006 4:15 PM Subject: [R] getMethod(s) and var.test> Hi, > > > > How do I retrieve the var.test() function code? I had a similar > problem once > before with another function but getMethods() solved the problem > then. Now I > tried several combinations for var.test() without success. > > > > Regards > > > > benjamin > > > > -- > Benjamin Otto > Universitaetsklinikum Eppendorf Hamburg > Institut fuer Klinische Chemie > Martinistrasse 52 > 20246 Hamburg > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ______________________________________________ R-help at stat.math.ethz.ch 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.