Hello, I have a beginner's Q: if i want to know all the functions provided by a package, what is command for that? in another word, Is there a command to list all the commands available in a packege? thanks a lot, yan
>-----Original Message----- >From: r-help-bounces at stat.math.ethz.ch >[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Yan Yu >Sent: Sunday, April 13, 2003 8:52 PM >To: r-help at stat.math.ethz.ch >Subject: [R] functions in a package > > >Hello, >I have a beginner's Q: > if i want to know all the functions provided by a package, >what is command for that? in another word, Is there a command >to list all the commands available in a packege? thanks a lot, yanLook at ?package.contents For example: package.contents("ctest") HTH, Marc Schwartz
E.g.: for package MASS, use: library(help="MASS") Jerome On April 13, 2003 06:52 pm, Yan Yu wrote:> Content-Length: 361 > Status: R > X-Status: N > > Hello, > I have a beginner's Q: > if i want to know all the functions provided by a package, > what is command for that? > in another word, > Is there a command to list all the commands available in a packege? > thanks a lot, > yan > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help-- Jerome Asselin (J?r?me), Statistical Analyst British Columbia Centre for Excellence in HIV/AIDS St. Paul's Hospital, 608 - 1081 Burrard Street Vancouver, British Columbia, CANADA V6Z 1Y6 Email: jerome at hivnet.ubc.ca Phone: 604 806-9112 Fax: 604 806-9044
Yan, I believe this very question was asked on this list in the past couple of weeks. One of the solutions was > search() # gives a list of loaded packages > ls(pos=2) # lists all functions in pos=2 of the search path Regards, Andrew C. Ward CAPE Centre Department of Chemical Engineering The University of Queensland Brisbane Qld 4072 Australia andreww at cheque.uq.edu.au Quoting Yan Yu <yanyu at cs.ucla.edu>:> Hello, > I have a beginner's Q: > if i want to know all the functions provided by a package, > what is command for that? > in another word, > Is there a command to list all the commands available in a > packege? > thanks a lot, > yan > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
In a message dated 4/13/03 10:06:12 PM Eastern Daylight Time, yanyu@cs.ucla.edu writes:> Hello, > I have a beginner's Q: > if i want to know all the functions provided by a package, > what is command for that? > in another word, > Is there a command to list all the commands available in a packege? > thanks a lot, > yan >You may also try:> help.start()to browse help files for packages and functions in html format in a web browser. For a beginner it may be helpful to know not only the function names, but also what they do, and how to use them. --Anupam. [[alternate HTML version deleted]]
Below is a function that lists all packages (called without an argument) or the functions in a package (called with the package name - quotes not needed). "libs"<- function (Lib) { if (missing(Lib)) print(.packages(all = TRUE), q = F) else eval(parse(text = paste("library(help=", as.character(substitute(Lib)),")"))) } ------------------------------------------- Jeffrey M Breiwick, Ph.D. National Marine Mammal Lab., AFSC, NOAA 7600 Sand Point Way NE, Bldg. 4 Seattle, Washington 98115 USA
Below is a function that lists all packages (called without an argument) or the functions in a package (called with the package name - quotes not needed). "libs"<- function (Lib) { if (missing(Lib)) print(.packages(all = TRUE), q = F) else eval(parse(text = paste("library(help=", as.character(substitute(Lib)),")"))) } ------------------------------------------- Jeffrey M Breiwick, Ph.D. National Marine Mammal Lab., AFSC, NOAA 7600 Sand Point Way NE, Bldg. 4 Seattle, Washington 98115 USA ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
You might be interested in the function lsf.str(), which lists all functions and their argument lists. For example,> library(foreign) > lsf.str("package:foreign")data.restore : function (file, print = FALSE, verbose = FALSE, env .GlobalEnv) lookup.xport : function (file) read.S : function (file) read.dta : function (file, convert.dates = TRUE, tz = "GMT", convert.factors = TRUE) read.epiinfo : function (file, read.deleted = FALSE, guess.broken.dates FALSE, thisyear = NULL, lower.case.names = FALSE) read.mtp : function (file) read.spss : function (file, use.value.labels = TRUE, to.data.frame FALSE, max.value.labels = Inf) read.ssd : function (libname, sectionnames, tmpXport = tempfile(), tmpProgLoc = tempfile(), sascmd = "sas") read.xport : function (file) write.dta : function (dataframe, file, version = 6, convert.dates = TRUE, tz = "GMT", convert.factors = c("labels", "string", "numeric", "codes"))>-roger _______________________________ UCLA Department of Statistics http://www.stat.ucla.edu/~rpeng On Sun, 13 Apr 2003, Yan Yu wrote:> Hello, > I have a beginner's Q: > if i want to know all the functions provided by a package, > what is command for that? > in another word, > Is there a command to list all the commands available in a packege? > thanks a lot, > yan > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >