library(Rdistance)Loading required package: units
udunits database from C:/Users/trent/AppData/Local/R/win-library/4.5/units/share/udunits/udunits2.xml
Rdistance (v4.1.1)

Trent McDonald
December 5, 2025
December 5, 2025
Follow these steps to get Rdistance up and running.
Rdistance is an R package. To install and use Rdistance, first install base R. If R is already installed, skip this.
Many R (and Rstudio) tutorials exist. The tutorial here has instructions for both Windows and Ubuntu.
A nice Linux-centric tutorial is here.
Rdistance depends on and imports a number of other packages. While Rdistance itself does not require compilation, some dependent packages require compilation. Compilation of these dependencies requires either Rtools (on Windows systems) or r-base-dev (on Linux systems). The number of dependencies is large, in part because Rdistance imports dplyr, so a fresh installation requires patience. If Rtools is already installed, skip this step.
RtoolsTo install Rtools, download the correct Rtools installer for your version of R from here. When download completes, run the installer (double-click it) and accept all default options.
r-base-dev:The equivalent of Rtools on Linux systems is r-base-dev. If R is already installed on a linux system, chances are that the machine’s repository lists are updated to include cloud.r-project.org/bin/linux/ubuntu (see ‘Installation’ section of here). Updated repository lists insure that the following apt get command functions correctly.
Rtools with the following command (in terminal):Rdistance requires the units package, and the units package requires the udunits library. Install the udunits library on linux systems via:Once R is installed and running, install the current stable release or the development release with the following commands:
Rdistance is under active development, and the ‘development’ version often contains patches between official releases. Inspect the commit messages on GitHub for a description of the patches. Install the development version using:if( !require("devtools") ){
install.packages("devtools")
}
devtools::install_github("tmcd82070/Rdistance")When everything is installed, the library command shows that the units package is loaded and the Rdistance’s verson number1.
Suppress these messages with suppressPackageStartupMessages(library(Rdistance)).↩︎