Installing R
Project managers, who are members of the "pxxx-admin-group," can install applications from the Software Center.
Installing packages
Because workstations offered by TSD are deliberately (to help maintain security of project work) cut off from the Internet, including CRAN, we maintain local mirrors (copies) of the CRAN and Bioconductor repositories on the TSD network and additionally configure R (using a .Rprofile
file), to allow for seamless package installation.
Linux
The install.packages
command can be used for installing a hypothetical package called "fantasia", with all its dependencies:
install.packages("fantasia")
Windows
For Windows hosts that have R
versions 4.0.3 or greater installed, the following applies for all versions of R
on that host:
install.packages("fantasia")
Packages are by default installed somewhere where storage quotas and free space may run full. On Windows, for example, this may be the C:
drive. Please tell us if you suspect the storage may have run full and we will help you rectify the problem.
If a another version of R is required, then the PI or and admin in the project can install it, as described on this page.
Rprofile.site
file available in the \\tsd-evs\shared\R
folder. To have the configuration applied automatically when R starts, you may copy the file into your home directory, renaming it to .Rprofile
there. Alternatively you can source the file (once per every R session) with an R command line like source("\\\\tsd-evs\\shared\\R\\Rprofile.site") .If packages fail to install
Sometimes packages will fail to install, usually because they are not offered in our mirrors, the installation procedure requires something from the Internet (e.g. Github packages), or because an external (build) library is missing. Installing these packages requires that you first find the "archive" version of the package and import it into TSD. The procedure is easier to explain with an example, below for a package called pystr
:
- Find the archive of the package, starting at https://cran.r-project.org/web/packages/pystr/index.html, for instance.
- Download the archive, i.e.
pystr_2.0.0.tar.gz
- Import the archive into TSD (please move it out of the import folder as it's not intended as a "work" folder)
- Install the package from [the archive] file, using either of the following methods:
- With the Windows command prompt:
R CMD INSTALL /path/to/some/dir/pystr_2.0.0.tar.gz
- Through
R
:install.packages("/path/to/some/dir/pystr_2.0.0.tar.gz", repos = NULL, type = "source")
- With the Windows command prompt:
Build tools
Packages require build tools (gcc
, make
) to be build from source. Windows hosts need to have the "Rtools" software installed. Ask your project administrator to install Rtools from the Software Center on Windows hosts.
On Colossus most R
modules have the needed dependencies in their toolchain. Contact us for help with installation of system dependencies on Linux login nodes.
When installing devtools please check if your VM has all the dependencies. you could use the command dnf grouplist "Development Tools"
to make sure that the development tools are installed.
Please contact us for help if the development tools are not installed.
Github
Github repositories or package releases are usually compressed as .zip. These packages need to unzipped inside TSD and then installed. First make sure devtools is installed:
library("devtools")
If you get error message "There is no package called devtools", then install devtools like this:
install.packages("devtools")
Then use the following command to install the package:
devtools::install("path/to/some/unzipped/package/")
The stringi
package
One package that is often problematic to install is stringi
. To facilitate its installation, we offer it as an archive file under /tsd/shared/R
(Linux) / \\tsd-evs\shared\R
(Windows) folder:
install.packages("/tsd/shared/R/misc/stringi_1.4.6.tar.gz", repos = NULL, type = "source")
Rmarkdown
Windows hosts require "Miktex" to be installed to render markdown files as pdf. Ask your project administrator to install Miktex via Self-Service on Windows hosts.
Bundling packages "outside" TSD and importing these
TSD end users have created the tsdrtools R package to facilitate installing packages that are not readily available through TSD. The package downloads and bundles the software "outside" TSD, which you can then import into TSD and extract for use. Since this is a 3rd-party package not supported by TSD, you'll need to contact the package developers if you experience issues.
If you experience issues installing packages after following the above instructions, feel free to contact us for help with the installation, providing relevant details including the name of the package, download location and the name of the host (machine) for the installation.
Call us
Opening hours are weekdays from 08:30 to 17:00 and Saturdays from 10:00 to 15:00.
Phone number: 22 84 00 04
Book a Zoom meeting
Students and employees can book a Zoom meeting with UiO Helpdesk. Available hours are Tuesday to Thursday between 11:00 and 13:00.
Book a video call