depend: Declare dependencies of modules

Description Usage Arguments Value Examples

View source: R/depend.R

Description

This function will check for a dependency and tries to make it available if it is not. This is a generic function. Currently only a default method exists which assumes a package name as argument. If a package is not installed depend tries to install it.

Usage

1
2
3
4
depend(on, ...)

## Default S3 method:
depend(on, version = "any", libPath = NULL, ...)

Arguments

on

(character) a package name

...

arguments passed to install.packages

version

(character) a version, defaults to 'any'

libPath

(character | NULL) a path to the library (folder where packages are installed)

Value

TRUE if dependency is available or successfully installed. An error if dependency can not be installed and is not available.

Examples

1
2
3
4
# Depend on certain R version
depend("base", "3.0.0")
# Depend on package version
depend("modules", "0.6.0")

modules documentation built on Feb. 7, 2021, 1:06 a.m.