Present since hutils v1.2.0. Alias for if (!requireNamespace(pkg, quietly = TRUE)) yes else no. Typical use-case would be RQ(pkg, install.packages("pkg"))].

Default values for yes and no from hutils v1.5.0.

This function is not recommended for use in scripts as it is a bit cryptic; its use-case is for bash scripts and the like where calls like this would otherwise be frequent and cloud the message.

RQ(pkg, yes = NULL, no = NULL)

Arguments

pkg

Package to test whether the package is not yet installed.

yes

Response if pkg is not installed.

no

(optional) Response if pkg is installed.

Examples

# NOT RUN {
 RQ("dplyr", "dplyr needs installing")
# }