Description Usage Arguments Details Value Author(s) See Also Examples
Obtain a summary by package of a findFn
object give it class packageSum
.
This is a simple function, first calling
PackageSum2
, than assigning
class packagesum
to it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | packageSum(x,
fields=c("Title", "Version", "Author", "Maintainer",
"Packaged", 'helpPages', 'vignette', 'URL'),
lib.loc=NULL, ...)
## S3 method for class 'findFn'
packageSum(x,
fields=c("Title", "Version", "Author", "Maintainer",
"Packaged", 'helpPages', 'vignette', 'URL'),
lib.loc=NULL, ...)
## S3 method for class 'data.frame'
packageSum(x,
fields=c("Title", "Version", "Author", "Maintainer",
"Packaged", 'helpPages', 'vignette', 'URL'),
lib.loc=NULL, ...)
## S3 method for class 'list'
packageSum(x,
fields=c("Title", "Version", "Author", "Maintainer",
"Packaged", 'helpPages', 'vignette', 'URL'),
lib.loc=NULL, ...)
|
x |
a data.frame with columns |
fields |
character vector of names of columns to add to Component 'Packaged' receives special treatment. If
present, only the portion preceding ';' will be retained.
This seems to be a time stamp automatically generated by
something like |
lib.loc |
an optional |
... |
additional arguments (currently unused) |
With an object of class findFn
, call
PackageSum2
, then make it class
packageSum
.
If less than half of the package reference are
installed, it prints a note suggesting the
user call installPackages
, because
much of the information is obtained from
the packages' DESCRIPTION
file.
a data.frame
of class
c('packageSum', 'data.frame').
Spencer Graves
findFn
PackageSum2
PackageSummary
installPackages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ##
## data.frame method
##
tstdf <- data.frame(Package=c('grid', 'base'),
stringsAsFactors=FALSE)
tst2 <- packageSum(tstdf)
##
## list method
##
tstList <- list(PackageSummary=tstdf)
all.equal(tst2, packageSum(tstList))
##
## findFn method
##
tst.findFn <- data.frame(
Package=c('grid', 'base')[c(1,1,2)],
Score=2:4, Date=LETTERS[1:3], stringsAsFactors=FALSE)
attr(tst.findFn, 'PackageSummary') <-
PackageSummary(tst.findFn)
class(tst.findFn) <- c('findFn', 'data.frame')
tst2. <- packageSum(tst.findFn)
all.equal(tst2, tst2.[names(tst2)])
##
## spline example
##
splineHelp <- findFn("spline", maxPages = 2)
splinePkgs <- packageSum(splineHelp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.