This works:
help(package="ggplot2")
This does not:
x <-"ggplot2"
help(package=x)
# Error in find.package(pkgName, lib.loc, verbose = verbose) :
# there is no package called ‘x’
How can I make it so that I can pass x to help to open the help page?
Put the variable in parentheses:
x <-"ggplot2"
help(package=(x))
The help file for ?help
rather cryptically states for the package argument:
To avoid a name being deparsed use e.g. (pkg_ref) (see the examples).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With