Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

withRepos

Evaluate an R expression with repositories set temporarily


Description

Evaluate an R expression with repositories set temporarily.

Usage

withRepos(expr, repos="[[mainstream]]", ..., substitute=TRUE, envir=parent.frame())

Arguments

expr

The R expression to be evaluated.

repos

A character vector of repositories to use.

...

Additional arguments passed to useRepos().

substitute

If TRUE, argument expr is substitute():ed, otherwise not.

envir

The environment in which the expression should be evaluated.

Value

Returns the results of the expression evaluated.

Author(s)

Henrik Bengtsson

See Also

Internally, eval() is used to evaluate the expression. See also options() and install.packages.

Examples

## Not run: 
  # Install from BioC related repositories only
  withRepos(install.packages("edgeR"), repos="[[BioC]]")

  # Install from CRAN or BioC related repositories only
  withRepos(install.packages("edgeR"), repos=c("CRAN", "[[BioC]]"))

  # Install from mainstream repositories only (same as previous)
  withRepos(install.packages("edgeR"), repos="[[mainstream]]")

  # Install from R-Forge and mainstream repositories only
  withRepos(install.packages("R.utils"), repos="[[R-Forge]]")

  # Update only CRAN packages
  withRepos(update.packages(ask=FALSE), repos="[[CRAN]]")

  # Update only Bioconductor packages
  withRepos(update.packages(ask=FALSE), repos="[[BioC]]")

## End(Not run)

R.utils

Various Programming Utilities

v2.10.1
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.