Skip to contents

Toggles or removes installations of patRoon that were installed by the legacy installation script (install_patRoon.R).

Usage

toggleLegacy(enable = NULL, ask = TRUE)

removeLegacy(restoreRProfile = FALSE, ask = TRUE)

Arguments

enable

Enables (enable=TRUE), disables (enable=FALSE) or toggles (enable=NULL) a legacy patRoon installation.

ask

Set to TRUE to ask before proceeding. No effect on non-interactive R sessions.

restoreRProfile

If TRUE then the modifications to the user's .Rprofile file will be removed that were automatically performed by the legacy installation script.

Value

All functions return NULL invisibly.

Details

Previous versions of patRoon (<2.3) could be installed via a (now legacy) installation R script (install_patRoon.R). The functions documented here can (temporarily) undo the changes by this script, so that the installation functions in this package can be used to manage patRoon installations.

The toggleLegacy() function is used to enable or disable legacy installations temporarily.

The removeLegacy() function is used to undo legacy installations.

Note

The R session should be restarted to make the changes effective.

Background

This section is purely informative, but may be of use when you want to manually manage legacy installations.

The legacy installation script typically results in the following changes:

  1. ~/patRoon-install: a directory with external dependencies (MetFrag, SIRIUS, ...) and may contain R packages from the patRoonDeps repository depending on user input during the installation.

  2. ~/.Rprofile-patRoon.R: An R script that should be loaded during R startup, and initializes the configuration needed to use the files (1).

  3. Code in ~/.Rprofile to actually load (2) on R startup (only if it exists)

When toggleLegacy() is used to disable legacy installations the function simply renames the initialization script (2) so it won't be loaded on R startup. The removeLegacy() function removes the files from (1-2) and optionally the changes from (3).