A portable R environment for Windows
REnPortable is a portable 64-bit only R environment for Windows. It was put together using the PortableApps.com launcher but is not endorsed by and does not fully comply with all PortableApps.com requirements.
To use REnPortable you need to supply your own 64-bit copy of R(base), Rtools, RStudio Desktop (Open Source Edition). REnPortable was tested with R v4.0+, Rtools v4.0, and RStudio Desktop v1.3.+ on Windows 10 Pro (x64). No support is offered for any of these programs; please use the relevant support pages.
The reason for putting together REnPortable was to have a complete, portable R environment to learn R and RStan. Therefore, all the preliminary work is complete to install the RStan package and dependencies in REnPortable. If you copy the program files for R, Rtools, and RStudio into the correct folders, then the following instructions for getting RStan up and running can be skipped:
- Checking the C++ toolchain, should work but you can always double check.
- Configure of the C++ toolchain because it has already been done for you (see
- The size of the 64-bit versions of R, RStudio, and Rtools together is approximately 1.8 GB. If you want to add other R packages you will need room for these too. For example, RStan plus dependencies adds another ~350 MB. You could save ~700 MB by excluding Rtools but REnPortable has not been tested without Rtools and RStan will not work without Rtools.
- You can download the REnPortable zip file and unzip to any place on a Windows 64-bit machine, USB, or external drive.
- If you have installed 64-bit versions of R, Rtools, or RStudio, you can copy the program files for each into the appropriate folders in the Apps directory (see Folder structure below).
- If you have not installed 64-bit versions of R and Rtools you will need to install them (choose to install the 64-bit versions only), copy the program files to the correct folders in REnPortable and then uninstall R and Rtools. RStudio Desktop can be downloaded as a zip file and unzipped into the appropriate RStudio folder.
Note - When you start REnPortable, RStudio may ask you for the version of R you wish to use. Please select the version of R that is in
\App\Rbase (see folder structure below); if you do not have R installed, this should be the only version listed.
Note - When it is time to update R(base), Rtools, RStudio, and other program files, it is usually best to delete the old files first and then copy/paste the new ones. This prevents old, unused files or versions of files from causing problems.
- AppInfo – Files for portability of REnPortable, there is no reason to edit these unless you know what you are doing.
- CmdStan - (Optional) Unpack CmdStan here before building. You can comment out all the lines in
\CmdStan\install-tbb.batbecause the path is already set for you.
- PortableGit - (Optional) Portable Git for Windows (64-bit) can be extracted here if you use git with R. The path to
\PortableGit\cmdis already set for you.
- Rbase – Where to put the R(base) program files (and updated versions of R). Updated R base packages are also saved here.
- RStudio – Where to put the RStudio program files (and updated versions of RStudio).
- Rtools – Where to put the Rtools program files (and updated versions of Rtools). The empty folders
tmpare required for Rtools to work properly.
- TinyTex - (Optional) For TinyTex files. If you install TinyTex from R/RStudio (
install_tinytex(force = TRUE, dir = tinytex_root(), add_path = FALSE)) the main application files go here.
- RData – The working directory\folder for R and RStudio, e.g.
- RLibrary – Contributed R packages are saved to this folder (i.e.
R_LIBS_USER) to separate them from the R program. If you install RStan, this is where the files will be saved rather than under
\App\Rbase. It means that R(base) can be updated independently of any contributed packages you add.
- Settings - You probably do not need to change anything in this folder unless something goes wrong. Most of the settings files and folders are copied to the user profile when REnPortable starts. When REnPortable closes, the folders and files are moved back to their original locations. This means that start and close times may be slower than for installed programs.
- Local - Copied to
- R – R crash-handler files.
- RStudio – Contains
- RStudio-Desktop – RStudio Desktop files.
- Profile - Contains the
- Rbase - Contains
Renviron.sitefile. The file has settings for R such as the location of
R_LIBS_USER. This file is copied to
App\Rbase\etcwhen REnPortable starts and then moved back when close REnPortable closes.
- Roaming - Copied to
- R - For rsconnect.
- RStudio - RStudio preferences. The file
rstudio-prefs.jsonincludes the initial working directory for RStudio which is set to
- Local - Copied to
- Temp – Required for temporary files for R/RStudio (I haven't seen anything saved there yet but who knows?).
Various files for portability, there is no reason to edit these unless you know what you are doing.