##
## data.frame method
##
tstdf <- data.frame(Package=c('grid', 'base'),
stringsAsFactors=FALSE)
tst2 <- packageSum(tstdf)
##
## list method
##
tstList <- list(PackageSummary=tstdf)
stopifnot(
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)
stopifnot(
all.equal(tst2, tst2.[names(tst2)])
)
##
## spline example
##
splineHelp <- findFn("spline", maxPages = 2)
splinePkgs <- packageSum(splineHelp)
Run the code above in your browser using DataLab