Skip to content

spatialRF

1.1.5Package record

Easy Spatial Modeling with Random Forest

0packages depend
5.4Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

Automatic generation and selection of spatial predictors for Random Forest models fitted to spatially structured data. Spatial predictors are constructed from a distance matrix among training samples using Moran's Eigenvector Maps (MEMs; Dray, Legendre, and Peres-Neto 2006 DOI:10.1016/j.ecolmodel.2006.02.015) or the RFsp approach (Hengl et al. DOI:10.7717/peerj.5518). These predictors are used alongside user-supplied explanatory variables in Random Forest models. The package provides functions for model fitting, multicollinearity reduction, interaction identification, hyperparameter tuning, evaluation via spatial cross-validation, and result visualization using partial dependence and interaction plots. Model fitting relies on the 'ranger' package (Wright and Ziegler 2017 DOI:10.18637/jss.v077.i01).

Changes in 1.1.5
  • Fixed Windows-specific error in get_response_curves(), plot_response_curves(), rf_evaluate(), and rf() where predict() method dispatch failed to find predict.ranger(). Added @importFrom ranger ranger to ensure ranger's namespace is loaded and S3 methods are properly registered.
  • Code quality improvements: fixed 129 linting issues identified by jarl linter, including inefficient vector logic operators in if statements (| → ||, & → &&), redundant equality comparisons (== TRUE → direct boolean), and corrected two bugs in on.exit() calls that weren't properly restoring user options.
  • Fixed error Error in validate_prop(value, prop, check_fun, check_values, reset_na) : check_fun(value) is not TRUE generated by huxtable::set_all_borders(TRUE).
  • Fixed warning "Using size aesthetic for lines was deprecated in ggplot2 3.4.0. ℹ Please use linewidth instead." produced by outdated calls to geom_line().
  • Fixed issue with deprecated argument draw_quantiles of geom_violin().
  • Replaced deprecated calls to ggplot2::aes_string() with ggplot2::aes() plus .data[[whatever]].
  • Fixed parallelization issues with zombi processess across functions.
  • Added internal helper function setup_parallel_execution() to centralize and improve parallel backend management across all functions. Now properly detects and respects user-configured backends (via future, doParallel, etc.) while maintaining support for external and internal cluster objects.
  • Refactored cluster setup code across all parallelized functions (rf_spatial(), rf_evaluate(), rf_tuning(), rf_repeat(), rf_compare(), rf_importance(), the_feature_engineer(), select_spatial_predictors_sequential(), select_spatial_predictors_recursive()) to use the new helper, improving consistency and reducing code duplication.
  • Removed if(interactive()){} wrappers from function examples to ensure examples run during R CMD check.
  • Function rf_spatial() now fits a spatial model even when that's not necessary.
  • Simplified auto_cor() and auto_vif() with unified sequential evaluation algorithm that better preserves user preference order.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 9.5 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-18
  • WARNING12 OK, 1 WARNING2026-09-12
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
Show 3 earlier changesHide 3 earlier changes
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK12 OK2026-04-25
  • NOTE11 OK, 3 NOTE2026-03-10
Advisories

none known

Documentation

In release 1.1.5
README· In the repository, left out of the releaseVignettes· In the repository, left out of the releaseNEWSYes · 100% structured · mentions 1.1.5Citation fileYes · cites a publicationWebsiteYes · pkgdown

The repository also keeps web-only articles.

Cites a JSS article
Help pages
74 (1 internal)
Examples that run
97%62 run in a plain check (14 of them under a condition) · 2 never run
Exported functions with examples
95%
Documented parameters
94%
Return-value docs
100%
Help pages citing references
0%

Downloads

5.4K
CRAN downloads in the past year
Rank #6,827 · ~15/day · ~449/mo
Daily download trend is not available in this view yet.
57230 days
1.2K90 days
5.4K1 year
Compare downloads with other packages →
Also on212 r2u6 autocran

Repository

126Stars
18Forks
1Open issues
0Open PRs
4Releases
490Commits
1Commit identities
spatial-regressionrandom-forestspatial-analysis
490 commits · Last activity 2026-07-15 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
0%
Median days to close, 50 most recently updated closed issues
38
Median days to close, 50 most recently updated closed PRs
2

Stars over time

2025-05-14 · 1152026-09-12 · 126
PracticesBeta

8 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/blasbenito/spatialrf on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-07-15 · The repository has a site deploy workflow

pkgdown site last built 2026-07-15

CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
15 external dependencies (excludes base and recommended)

Installing spatialRF adds 49 packages (26 with compiled code, 42 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, patchwork 3.2 MB.

Depends (1)
R >= 2.10
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (1)
Author, Maintainer since 1.1.3 (2021), Copyright holder
Releases (3)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 1.1.5Latest
    record
    2025-12-20 · current release · diff ↗ ·
    removed 3 exports
    .select_by_max_vif, .select_by_preference, vif
    added 2 exports
    %>%, setup_parallel_execution
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 1.1.4
    record
    2022-08-19 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 1.1.3
    record
    2021-09-23
  • R
    R 4.1.0 released · 2021-05-18

Package metadata

First published
2021-09-23
Total releases
3 / 5 yrs
License
MIT + file LICENSE OSI · relicensed from GPL-3 in 1.1.5
Minimum R
≥ 2.10
Bundled data
942 KB / 7 files
Download size
3.4 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' entry:

citation("spatialRF")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.18637/jss.v077.i01, 10.5281/zenodo.4745208.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for spatialRF version 1.1.5 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy