des1 <- findFn('differential equations', 1)
de1 <- findFn('differential equation', 1)
# each retrieves 1 page of 20 hits
# but not the same 20
de.s <- unionFindFn(des1, de1)
# combines the two, eliminating duplicates.
# or the sorter version:
de.s. <- des1 | de1
stopifnot(
all.equal(de.s, de.s.)
)
# \dontshow{
# union with no data
de0 <- unionFindFn(des1[numeric(0), ], de1[numeric(0), ])
# }
# Keep only the common entries.
de2 <- intersectFindFn(des1, de1)
de2. <- des1 & de1
stopifnot(
all.equal(de2, de2.)
)
# summary and print still work with the combined object.
summary(de.s)
if(!CRAN()){
de.s
}
summary(de2)
if(!CRAN()){
de2
}
# \dontshow{
# The following gave an error; now fixed 2009.05.12
x <- try(findFn("spline", maxPages = 1, quiet = TRUE))
y <- try(findFn("winbugs", maxPages = 1, quiet = TRUE))
if(!(inherits(x, 'try-error') ||
inherits(y, 'try-error'))){
xy <- intersectFindFn( x, y )
}
# }
Run the code above in your browser using DataLab