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!
Examples
# Linux: common installation (script in /usr/bin,
# desktop entry in /usr/share/applications)
# (requires administrator permissions)
if (FALSE) {
# the administrator password is asked interactively
install_MODIStsp_launcher(sudo = TRUE)
}
# Linux: installation in a directory which does not require administrator
# permissions
if (FALSE) {
install_MODIStsp_launcher(bin_dir = "~/bin", desktop_dir = "~/Desktop")
}
# Windows: common installation
# (script in the Start Menu and shortcut on the desktop)
if (FALSE) {
install_MODIStsp_launcher()
}