needs: Attach/install packages

Description Usage Arguments Details See Also Examples

View source: R/needs.R

Description

needs loads and attaches packages, automatically installing (and attaching) any it can't find in your libraries. It accepts any number of arguments, given as names or character strings. Optionally, supply a minimum version on a per-package basis to update old packages as needed.

Usage

1
needs(..., .printConflicts = F)

Arguments

...

Packages, given as unquoted names or character strings. Specify a required package version as package = "version".

.printConflicts

Logical, specifying whether to print a summary of objects that exist in multiple places on the search path along with their respective locations. Set to TRUE to identify any masked functions. Objects in the base package and the global environment are ignored. Defaults to FALSE.

Details

Recommended use is to allow the function to autoload when prompted the first time the package is loaded interactively. To change this setting later, run needs:::autoload(TRUE) or needs:::autoload(FALSE) to turn autoloading on or off, respectively.

See Also

needs-package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
needs()   # returns NULL

needs(foo, bar)

# require a minimum version
needs(foo,
      bar = "0.9.1",
      baz = "0.4.3")



## End(Not run)

needs documentation built on May 1, 2019, 10:10 p.m.