Description Usage Arguments Details Value Author(s) See Also Examples
Add information on installed packages to the PackageSummary
of
an RSiteSearch
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
## S3 method for class 'RSiteSearch'
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
## S3 method for class 'data.frame'
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
## S3 method for class 'list'
PackageSum2(x,
fields=c("Title", "Version", "Author", "Maintainer", "Packaged"),
lib.loc=NULL, ...)
|
x |
a data.frame with columns |
fields |
character vector of names to look for in components of
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 RSiteSearch
, 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 RSiteSearch
object, add
other columns from attributes
of packageDescription
for
installed packages named in the column Package
.
a data.frame with additional fields
columns appended to
x
.
Spencer Graves
RSiteSearch.function
PackageSummary
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 | ##
## data.frame method
##
tstdf <- data.frame(Package=c('fda', 'base'), stringsAsFactors=FALSE)
tst2 <- PackageSum2(tstdf)
##
## list method
##
tstList <- list(PackageSummary=tstdf)
all.equal(tst2, PackageSum2(tstList))
##
## RSiteSearch method
##
tstRSearch <- data.frame(Package=c('fda', 'base')[c(1,1,2)], Score=2:4,
Date=LETTERS[1:3], stringsAsFactors=FALSE)
attr(tstRSearch, 'PackageSummary') <- PackageSummary(tstRSearch)
class(tstRSearch) <- c('RSiteSearch', 'data.frame')
tst2. <- PackageSum2(tstRSearch)
# row names are different from tst2, so fix ...
row.names(tst2.) <- row.names(tst2)
all.equal(tst2, tst2.[names(tst2)])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.