##
## 1. findFn object
##
spl <- try(findFn("spline", maxPages = 2))
if(!inherits(spl, "try-error")){
# check the code but do not install anything:
installPackages(spl, minCount=spl[1, 'Count']+1)
# default: install packages with
# Count>=minCount
#\dontrun is sometimes run on CRAN. See
#https://github.com/ThinkR-open/prepare-for-cran
#accessed 2021-06-14
if (interactive()) {
installPackages(spl)
}
##
## 2. packageSum object
##
splS <- packageSum(spl)
# check the code but do not install anything:
installPackages(splS, splS[1, 'Count']+1)
# install ALL packages
if (interactive()) {
installPackages(splS, 1)
}
}
Run the code above in your browser using DataLab