I would like to learn what functions are available in a given R package (say, the pkg sma) and what the arguments and return value is for each of those functions. Is there an R CMD available for that or a suggested method for easily extracting that information? thanks, Natalie. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
extracting pkg fcn info
5 messages · Natalie Hawkins, Thomas Lumley, Brian Ripley +1 more
On Mon, 2 Jul 2001, Natalie Hawkins wrote:
I would like to learn what functions are available in a given R package (say, the pkg sma) and what the arguments and return value is for each of those functions. Is there an R CMD available for that or a suggested method for easily extracting that information?
help(library="package")
will give a listing of the functions (and perhaps other information).
For a list of all the arguments and return values I would suggest the PDF
manual pages for that package. These are all on CRAN or can be built from
the latex help.
You could get the arguments from
library("somepackage")
sapply(ls(pos=2),function(nm) args(get(nm)))
but that wouldn't tell you want it meant.
-thomas
Thomas Lumley Asst. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
An extension to what Natalie asked -- has anyone written an R function
to do something like:
list.api(function)
which returns arguments, classes, and return statements?
best,
-tony
"TL" == Thomas Lumley <tlumley at u.washington.edu> writes:
TL> On Mon, 2 Jul 2001, Natalie Hawkins wrote:
>>
>>
>> I would like to learn what functions are available in a given R
>> package (say, the pkg sma) and what the arguments and return
>> value is for each of those functions.
>>
>> Is there an R CMD available for that or a suggested method for
>> easily extracting that information?
TL> help(library="package")
TL> will give a listing of the functions (and perhaps other
TL> information).
TL> For a list of all the arguments and return values I would
TL> suggest the PDF manual pages for that package. These are all
TL> on CRAN or can be built from the latex help.
TL> You could get the arguments from library("somepackage")
TL> sapply(ls(pos=2),function(nm) args(get(nm))) but that wouldn't
TL> tell you want it meant.
TL> -thomas
TL> Thomas Lumley Asst. Professor, Biostatistics
TL> tlumley at u.washington.edu University of Washington, Seattle
TL> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
TL> r-help mailing list -- Read
TL> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info",
TL> "help", or "[un]subscribe" (in the "body", not the subject !)
TL> To: r-help-request at stat.math.ethz.ch
TL> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
A.J. Rossini Rsrch. Asst. Prof. of Biostatistics U. of Washington Biostatistics rossini at u.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org -------- (wednesday/friday is unknown) -------- FHCRC: M-Tu : 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email UW: Th : 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 2 Jul 2001, A.J. Rossini wrote:
An extension to what Natalie asked -- has anyone written an R function
to do something like:
list.api(function)
which returns arguments, classes, and return statements?
The last may well depend on the inputs, and for generic functions just about anything will depend on the inputs. I don't see this as of much use apart from chacking documentation, and codoc does have code to extract the arguments from the help and the function. With a richer help system (being dreamt about) you would be able to get this from the documentation.
best, -tony
"TL" == Thomas Lumley <tlumley at u.washington.edu> writes:
TL> On Mon, 2 Jul 2001, Natalie Hawkins wrote:
>>
>>
>> I would like to learn what functions are available in a given R
>> package (say, the pkg sma) and what the arguments and return
>> value is for each of those functions.
>>
>> Is there an R CMD available for that or a suggested method for
>> easily extracting that information?
TL> help(library="package")
TL> will give a listing of the functions (and perhaps other
TL> information).
TL> For a list of all the arguments and return values I would
TL> suggest the PDF manual pages for that package. These are all
TL> on CRAN or can be built from the latex help.
TL> You could get the arguments from library("somepackage")
TL> sapply(ls(pos=2),function(nm) args(get(nm))) but that wouldn't
TL> tell you want it meant.
TL> -thomas
TL> Thomas Lumley Asst. Professor, Biostatistics
TL> tlumley at u.washington.edu University of Washington, Seattle
TL> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
TL> r-help mailing list -- Read
TL> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info",
TL> "help", or "[un]subscribe" (in the "body", not the subject !)
TL> To: r-help-request at stat.math.ethz.ch
TL> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
A.J. Rossini Rsrch. Asst. Prof. of Biostatistics
U. of Washington Biostatistics rossini at u.washington.edu
FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org
-------- (wednesday/friday is unknown) --------
FHCRC: M-Tu : 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email
UW: Th : 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"BDR" == Brian D Ripley <Prof> writes:
BDR> On 2 Jul 2001, A.J. Rossini wrote:
>> An extension to what Natalie asked -- has anyone written an R
>> function to do something like:
>>
>> list.api(function)
>>
>> which returns arguments, classes, and return statements?
BDR> The last may well depend on the inputs, and for generic
BDR> functions just about anything will depend on the inputs.
That's true, and in some contexts, it would be nice to see it all.
(I.e. a list of potentially returned objects).
BDR> I don't see this as of much use apart from chacking
BDR> documentation, and codoc does have code to extract the
BDR> arguments from the help and the function.
Actually, it is of incredible use in OOP. Just not the form that R
(or XLispStat) uses.
best,
-tony
A.J. Rossini Rsrch. Asst. Prof. of Biostatistics U. of Washington Biostatistics rossini at u.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org -------- (wednesday/friday is unknown) -------- FHCRC: M-Tu : 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email UW: Th : 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._