Description Usage Arguments Details Value Author(s) See Also Examples
Add information on installed packages to the
PackageSummary
of a findFn
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer",
"Packaged", 'helpPages', 'vignette', 'URL'),
lib.loc=NULL, ...)
## S3 method for class 'findFn'
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer",
"Packaged", 'helpPages', 'vignette', 'URL'),
lib.loc=NULL, ...)
## S3 method for class 'data.frame'
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer",
"Packaged", 'helpPages', 'vignette', 'URL'),
lib.loc=NULL, ...)
## S3 method for class 'list'
PackageSum2(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
, extract the
PackageSummary
attribute and pass it to the
data.frame
method.
With an object of class list
, extract the
PackageSummary
component and pass it to the
data.frame
method.
For a data.frame
that is not an findFn
object, add other columns from attributes
of
packageDescription
for installed packages named
in the column Package
. Also, for any packages
that are installed, replace the Date
with the
Packaged
date. The Date
in Baron's
RSiteSearch database is the date of acquisition, which
will typically be more recent than the Packaged
date provided the locally installed package has the same
version as that in Baron's database. To get the best
information from PackageSum2
, it is wise to first
run both installPackages
to ensure that
the packages of greatest interest are installed locally
and update.packages()
to make sure you have the
latest versions installed locally. Similarly, if
PackageSum2
does not contain complete interest on
a package of interest, this can be fixed by installing
the package and rerunning PackageSum2
.
a data.frame with additional fields
columns
appended to a PackageSummary
data.frame
.
Spencer Graves
packageSum
, which does essentially the
same thing but returns an object of class
packageSum
.
findFn
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 | ##
## data.frame method
##
Tstdf <- data.frame(Package=c('grid', 'base'),
stringsAsFactors=FALSE)
Tst2 <- PackageSum2(Tstdf)
##
## list method
##
TstList <- list(PackageSummary=Tstdf)
all.equal(Tst2, PackageSum2(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. <- PackageSum2(Tst.findFn)
all.equal(Tst2, Tst2.[names(Tst2)])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.