The RangeShiftR package source is publicly released on a github repository as a beta version (it is not available on CRAN). For further information please contact us under RangeShiftR@uni-potsdam.de.

Install and load required packages

RangeShiftR has to be built from source by the user. This requires the R-version 3.6.0 or higher as well as a functional C++ toolchain (see below). All other dependencies are handled automatically during installation.

Install pak if you don’t have them already.

library("pak")
## Warning: package 'pak' was built under R version 4.5.2

Compiler toolchain

In order to build the package from source, C++ compiler toolchain is required. The exact procedure depends on your operating system.

Install the RangeShiftR package

Now, if all preparations are done and successful, we can install the package directly from its public repository on github, using pak:

pak::pak("RangeShifter/RangeShiftR-pkg/RangeShiftR@main")

After successful installation, which can take a few minutes, you can load and use the package:

library(RangeShiftR)
## RangeshiftR version 3.0.0 (24.03.2026)
## Copyright (C) 2020-2026 Anne-Kathleen Malchow, Greta Bocedi, Stephen C.F. Palmer, Justin M.J. Travis, Jette Wolff, Damaris Zurell
## 
## This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
## You are welcome to redistribute it and/or modify it under certain conditions;
## type 'RangeShiftR_license()' for details.

Troubleshooting

If pakis not able to install RangeShiftR one reason might be that R doesn’t find the C++ compiler due to an inappropriately set path variable. In this variable your system stores the paths in which to look for executables like the compiler (e.g. gcc or clang), in the order in which they appear in the path variable.

You can try and check if the path to the directory that contains your compiler is part of the path variable.
For example, on Windows 10: Go to Control panel -> System and Security -> System -> Advanced system settings -> Environmental variables.
In the list of system variables, look for ‘Path’. If the correct path is missing, you can add it manually:
Click ‘edit’ on the ‘Path’ variable -> add the correct variable (The two standard paths would be ‘C:\Rtools\bin’ and ‘C:\Rtools\mingw_32\bin’; you can also try moving them up on the list so they get searched first.)

For Linux you might need additional dependencies for required R packages, e.g. libcurl4-openssl-dev, libssl-dev or libxml2-dev

If questions or problems remain, please let us know via the github Forum.