Skip to main content

English

Install R packages

Requirements to install packages

Requirements to install packages networked (must have Internet access)

  • Connect to login0 of MareNostrum4:

    mylaptop$> ssh {username}@mn0.bsc.es
    IMPORTANT

    The MareNostrum4 login0 is restricted to BSC staff and is only accessible from the BSC internal network or the Virtual Private Network (VPN).

  • Check the Internet connectivity from login0, for example:

    $> wget --tries=3 --timeout=5 -q --spider google.com && echo "Networked" || echo "Non-networked"
    Networked

Install and manage packages

Install packages

  • Install a package from CRAN:

    $> install.packages("SomePackage")
  • Install multiple packages at once:

    $> install.packages(c("A", "B", "C", "D"))

Update packages

  • Update one or more specific packages:

    $> update.packages(oldPkgs = c("A", "B"))
  • Update all packages:

    $> update.packages()

Bioconductor

    $> BiocManager::install()

Remove packages

  • Remove a package:

    $> remove.packages("SomePackage")

Work with environments

  1. Create a file called ~/.Renviron containing the following line:

    $> R_LIBS=/path/to/my/R/local/project