install_MODIStsp_launcher: Install a launcher for MODIStsp

View source: R/MODIStsp_install_launcher.R

install_MODIStsp_launcherR Documentation

Install a launcher for MODIStsp

Description

Function which allows to use MODIStsp in batch mode by creating links

Usage

install_MODIStsp_launcher(
  bin_dir = NA,
  rscript_dir = NA,
  desktop_dir = NA,
  desktop_shortcut = TRUE,
  sudo = FALSE
)

Arguments

bin_dir
  • on Linux, directory in which the link to the bash script should be placed, Default: "/usr/bin" - use of a path included in the PATH environment variable is suggested;

  • on Windows, directory where to place the menu entry in the Start Menu, Default: Start Menu -> Programs -> MODIStsp.

rscript_dir

character in Windows only, the path of the directory in which Rscript is installed (usually is \"C:/Progra~1/R/R-version/bin/x64"). Edit this parameter if R is installed in a custom directory.

desktop_dir

character

  • on Linux, directory in which the desktop entry should be placed, Default: /usr/share/applications;

  • on Windows, directory where to place the desktop entry, Default: "Desktop" (Ignored if desktop_shortcut = FALSE).

desktop_shortcut

logical indicates if the desktop entry or the desktop shortcut should be created, Default: TRUE.

sudo

(Linux only) logical indicates if administrator rights have to be used to write within bin_dir and desktop_dir, If FALSE the root password is requested when launching the function. Note that using default values of bin_dir and desktop_dir requires to set this option to TRUE (or to launch the script in a root session of R), Default: FALSE

Details

MODIStsp can be used also as a stand-alone tool (i.e., without opening RStudio or R-GUI) by launching a bash/batch script, which is stored in the installation folder (/ExtData/Launcher) To allow to easily find it, this function creates a desktop entry and a symbolic link to the bash script (on Linux) or a link in the Start Menu to the batch script and a shortcut on the desktop (on Windows). Note that, if the packages MODIStsp is installed in a version-dependent directory (as the default one is), this function should be re-executed after an R upgrade, otherwise the links would continue to point to the old package version!

Value

The function is called for its side effects.

Note

License: GPL 3.0

Author(s)

Luigi Ranghetti, phD (2015)

Examples

# Linux: common installation (script in /usr/bin,
# desktop entry in /usr/share/applications)
# (requires administrator permissions)
## Not run: 
# the administrator password is asked interactively
install_MODIStsp_launcher(sudo = TRUE)

## End(Not run)

# Linux: installation in a directory which does not require administrator
# permissions
## Not run: 
install_MODIStsp_launcher(bin_dir = "~/bin", desktop_dir = "~/Desktop")

## End(Not run)

# Windows: common installation
# (script in the Start Menu and shortcut on the desktop)
## Not run: 
install_MODIStsp_launcher()

## End(Not run)

MODIStsp documentation built on Oct. 13, 2023, 5:11 p.m.