Pass character package name to help function

r

Solution

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).

Problem

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?

Original source