Set Up R Portable

Sheeraz Gul Jul 07, 2022
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.

  1. 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.

  2. 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.

  3. Once the R portable is downloaded, install it to the R Portable directory.

    Install R Portable

  1. Once the installation is completed, the next step is downloading and installing R-Studio Portable.

  2. The zip version of R-Studio is required, which can be downloaded here.

    Download R Studio

  3. Extract the R-Studio zip file to the R Portable directory.

  4. 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 the bin directory of R-Studio.

  5. 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.

  6. Once the version is selected in R-Studio, it is ready to work.

  7. Set the working directory in the R Portable directory by the following method.

    setwd("D:\R Portable\Portable Work Directory")
  8. Make sure you use \ for Windows in the path and / for Unix/macOS.

  9. 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")
  10. The above method will create a new path for libraries, and all the libraries for the portable versions will be saved.

  11. 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.

Author: Sheeraz Gul
Sheeraz Gul avatar Sheeraz Gul avatar

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