# Skip these tests on CRAN,
# because they take more than 5 seconds
if(!CRAN()){
z <- try(findFn("spline", maxPages = 2))
# alternative
zq <- try(???spline(2))
# Confirm z == zq except for 'call'
attr(z, 'call') <- NULL
attr(zq, 'call') <- NULL
if(!(inherits(z, "try-error") ||
inherits(zq, "try-error"))){
stopifnot(
all.equal(z, zq)
)
# To search for 2 terms, not necessarily together:
RSS <- try(findFn('RSiteSearch function', 1))
matches(RSS)
# To search for an exact string, use braces:
RSS. <- try(findFn('{RSiteSearch function}', 1))
matches(RSS.) # list(nrow = 0, matches = 0)
# example in which resulting page has some unicode characters
Lambert <- try(findFn("Lambert"))
Lambert
# Example that "found 2 link(s) without dates" on 2021-06-26
webScr <- try(findFn('web scraping'))
# Example that "found 0 matches" on 2021-09-06
try(findFn('{open history map}'))
}
}
Run the code above in your browser using DataLab