How to Set Up R Portable
The R portable means we can use the R language anywhere we want so that we don’t have to install it repeatedly on different machines. This tutorial demonstrates how to set up R portable.
Set-Up R Portable
Installing R as a portable becomes handy for usage, we can use it anywhere, and we don’t have to install it repeatedly. The R Portable files are available on SourceForge
.
Before starting the setup, we should keep in mind that the R file system scheme is Unix-based, so to use it in Windows, we use \
, and for systems like Mac/Unix, we use /
. ~
can be used for the home directory.
Follow the steps below to set up the R portable.
-
Portable systems work on portable or cloud drives, so either we can use DropBox/OneDrive or any USB drive. We need to create a directory
R Portable
, so the path to our drive will be~\D:\R Portable
. -
The next step is to download the R portable. The R portable can be found here; download it to the portable device in the
R Portable
folder. -
Once the R portable is downloaded, install it to the
R Portable
directory.
-
Once the installation is completed, the next step is downloading and installing R-Studio Portable.
-
The zip version of R-Studio is required, which can be downloaded here.
-
Extract the R-Studio zip file to the
R Portable
directory. -
Once the file is completely extracted, go to the R Studio directory and double-click the
rstudio.exe
to open it; you can find it in thebin
directory of R-Studio. -
The first time we start the R-Studio, it will ask for the current R version for the R-Studio. Go to the
~/R Portable/R-Portable/App/R-Portable
and select the folder.Make sure to select the appropriate version.
-
Once the version is selected in R-Studio, it is ready to work.
-
Set the working directory in the
R Portable
directory by the following method.setwd("D:\R Portable\Portable Work Directory")
-
Make sure you use
\
for Windows in the path and/
for Unix/macOS. -
To keep all the libraries installed in the R Portable version, create a path for libraries in the R-Portable version and set the libraries’ path to that directory. Use the following method.
.libPaths("D:\R Portable\Portable Libraries")
-
The above method will create a new path for libraries, and all the libraries for the portable versions will be saved.
-
The R-Portable and R-Studio Portable are ready to work now.
Following the above steps can create a portable version of R and R-Studio. If you don’t want to use the USB drive, you can also use DropBox or OneDrive.
Sheeraz is a Doctorate fellow in Computer Science at Northwestern Polytechnical University, Xian, China. He has 7 years of Software Development experience in AI, Web, Database, and Desktop technologies. He writes tutorials in Java, PHP, Python, GoLang, R, etc., to help beginners learn the field of Computer Science.
LinkedIn Facebook