R
R is a free statistical computing and graphics software.
It performs calculations written in a programming language called R and is widely used in the field of statistical analysis.
Usage
Currently, R version 4.3.3 is available on the login node and compute nodes.
No module
command is needed to use it.
Interactive use
Interactive is available by invoking R environment with R
command as follows.
|
Batch job
R scripts can be executed in job scripts of batch job
by adding --slave --vanilla
option as follows.
|
Install packages
When installing R packages using install.packages("Package_name")
in R, you may get warnings or errors.
Below are some cases that can be addressed.
Message '... is not writable' is displayed
In R, if you do not specify where to install the package, the following warning message is displayed when trying to install the package in a location that requires administrative privileges.
|
If you are using R interactively, selecting yes here will suggest installing to your home directory, which you can follow to complete the installation.
On the other hand, there are two ways to specify where to install the package in advance.
-
Install the package in the same place every time
For example, if you run the following, all packages will be installed in a directory calledRpackages
in your home directory next time. This is usually recommended.$ mkdir ${HOME}/Rpackages $ echo R_LIBS_USER = ${HOME}/Rpackages > ${HOME}/.Renviron
-
Specify the place for each
install.packages
You can specify the installation place (in this example /home/pj24001603/ku40000105/Rpackages) for install.packages as follows.> install.packages("markdown",lib="/home/pj24001603/ku40000105/Rpackages")
Message 'Please select a CRAN mirror' is displayed
A CRAN mirror is a site that can be used as a download source for R packages. If you are using R interactively, you can select it on the spot if you have not specified it beforehand.
On the other hand, if you execute, for example, the following, from your next R usage the site you specify (in this example, https://ftp.yz.yamagata-u.ac.jp/pub/cran/) will be used automatically.
|
Message '... does not seem to be installed on your platform' is displayed
Some packages require a separate tool to be installed, and if this tool is not found, the installation will fail with the following error message.
|
For example, in the above error, the message "Please install the hdf5 library" indicates that the hdf5 tool is required.
If you see this, you usually need to install the tool, but it may already be installed in Genkai. Therefore, we recommend that you first check it out using the show_module command in Genkai.
For example, if you look for a tool with the keyword hdf5 in the software installed in Genkai, as in the following example, we see that it is installed with the module name hdf5/1.14.4. We also see that the gcc-toolset/12 module is also required to use this module.
|
So, as shown in the following example, by loading these modules followed by R to install the package, the installation was successful.
|
If you are not sure whether the tools necessary to install the package are included in Genkai, please contact the contact person. (Access/Contact)