Skip to main content

Install from CRAN

The stable release of OpenLand is available on CRAN. This is the recommended installation method for most users:
install.packages("OpenLand")
This will automatically install all required dependencies.

Install from GitHub

To access the latest development features or bug fixes, install directly from GitHub:
# Install devtools if you don't have it
install.packages("devtools")

# Install OpenLand from GitHub
devtools::install_github("reginalexavier/OpenLand")
The development version may contain experimental features and is recommended only for users who need cutting-edge functionality or want to contribute to package development.

System Requirements

R Version

OpenLand requires R ≥ 3.4.0. Check your R version:
R.version.string
If you need to update R, download the latest version from CRAN.

Dependencies

OpenLand automatically installs the following required packages:
  • dplyr (≥ 0.8.3) - Data manipulation
  • tidyr (≥ 1.0.0) - Data tidying
  • ggplot2 (≥ 3.2.1) - Plotting
  • gridExtra (≥ 2.3) - Arranging plots
  • grid - Base graphics
  • raster (≥ 3.0.7) - Raster data handling
  • circlize (≥ 0.4.8) - Chord diagrams
  • networkD3 (≥ 0.4) - Sankey diagrams
  • methods - S4 class system
  • tmap - Enhanced spatial visualization
  • knitr - Vignette rendering
  • rmarkdown - Documentation

Manual Dependency Installation

If you encounter dependency issues, install them manually:
install.packages(c(
  "dplyr", "tidyr", "ggplot2", "gridExtra", "grid",
  "circlize", "networkD3", "raster", "methods"
))

Verification

After installation, verify that OpenLand is working correctly:
1

Load the package

library(OpenLand)
If successful, you should see no error messages.
2

Check package version

packageVersion("OpenLand")
This displays the installed version number.
3

Test with sample data

# Load the built-in dataset
data(SL_2002_2014)

# Check the structure
names(SL_2002_2014)
Expected output:
[1] "lulc_Multistep" "lulc_Onestep"   "tb_legend"      
[4] "totalArea"      "totalInterval"
4

Access documentation

# Open the main package help
?OpenLand

# Browse vignettes
browseVignettes("OpenLand")

Download Example Dataset

The package includes preprocessed data (SL_2002_2014), but you can also download the original raster dataset:
# Download the São Lourenço Basin RasterStack
url <- "https://zenodo.org/record/3685230/files/SaoLourencoBasin.rda?download=1"
temp <- tempfile()
download.file(url, temp, mode = "wb")
load(temp)

# Verify the raster
SaoLourencoBasin
The São Lourenço Basin dataset is approximately 22,400 km² covering the years 2002, 2008, 2010, 2012, and 2014. It’s provided by Embrapa Pantanal, Instituto SOS Pantanal, and WWF-Brasil.

Troubleshooting

Installation Fails on Linux

Some spatial packages require system libraries. On Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y \
  libgdal-dev \
  libproj-dev \
  libgeos-dev \
  libudunits2-dev
On Fedora/CentOS:
sudo yum install gdal-devel proj-devel geos-devel udunits2-devel

macOS Issues

If you encounter compilation errors on macOS, ensure you have Xcode command line tools:
xcode-select --install

Windows Issues

Windows users may need Rtools to compile packages from source:
  1. Download Rtools matching your R version
  2. Install with default settings
  3. Restart R and retry installation

Dependency Conflicts

If you have package version conflicts:
# Remove old package versions
remove.packages("OpenLand")

# Clear package cache
.libPaths()  # Check library paths

# Reinstall with fresh dependencies
install.packages("OpenLand", dependencies = TRUE)

Getting Help

GitHub Issues

Report bugs or request features on the official repository.

Package Documentation

Access comprehensive function documentation:
help(package = "OpenLand")

Next Steps

Now that OpenLand is installed, you’re ready to analyze land use change data:

Quick Start Tutorial

Follow a complete example using the São Lourenço Basin dataset to learn the core OpenLand workflow.

Build docs developers (and LLMs) love