/usr/share/doc/r-cran-r.utils/tests/use.R is in r-cran-r.utils 2.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 28 | library("R.utils")
# Use with one package
use("tools", how="load")
# Use with one package
use("tools")
# Use with multiple packages
use(c("tools", "graphics"))
use("tools, graphics")
use(c("tools, graphics", "grDevices"))
# Use with version constraint
use("tools", version="(>= 2.5.0)")
use("tools (>= 2.5.0)")
# Use with multiple packages and version constraints
use(c("tools", "graphics"), version=c("(>= 2.5.0)", "(>= 2.5.0)"))
use("tools, graphics", version="(>= 2.5.0), (>= 2.5.0)")
use("tools (>= 2.5.0), graphics (>= 2.5.0)")
# Exception should be visible
tryCatch({
use("NonExistingPackage", install=FALSE)
}, error = function(ex) {
print(ex);
})
|