RQ: Shorthand for 'requireNamespace'

View source: R/RQ.R

RQR Documentation

Shorthand for requireNamespace

Description

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.

Usage

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

## End(Not run)



hutils documentation built on April 13, 2022, 5:23 p.m.