Package: spatialRF 1.1.5

spatialRF: Easy Spatial Modeling with Random Forest

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>).

Authors:Blas M. Benito [aut, cre, cph]

spatialRF_1.1.5.tar.gz
spatialRF_1.1.5.zip(r-4.7)spatialRF_1.1.5.zip(r-4.6)spatialRF_1.1.5.zip(r-4.5)
spatialRF_1.1.5.tgz(r-4.6-any)spatialRF_1.1.5.tgz(r-4.5-any)
spatialRF_1.1.5.tar.gz(r-4.7-any)spatialRF_1.1.5.tar.gz(r-4.6-any)
spatialRF_1.1.5.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
spatialRF/json (API)

# Install 'spatialRF' in R:
install.packages('spatialRF', repos = c('https://blasbenito.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/blasbenito/spatialrf/issues

Pkgdown/docs site:https://blasbenito.github.io

Datasets:

On CRAN:

Conda:

random-forestspatial-analysisspatial-regression

6.42 score 124 stars 85 scripts 531 downloads 66 exports 52 dependencies

Last updated from:b7ab6291d6. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK349
source / vignettesOK298
linux-release-x86_64OK355
macos-release-arm64OK187
macos-oldrel-arm64OK195
windows-develOK269
windows-releaseOK263
windows-oldrelOK237
wasm-releaseOK226

Exports:.vif_to_df%>%aucauto_corauto_vifbeowulf_clustercase_weightsdefault_distance_thresholdsdouble_center_distance_matrixfilter_spatial_predictorsget_evaluationget_importanceget_importance_localget_moranget_performanceget_predictionsget_residualsget_response_curvesget_spatial_predictorsis_binarymake_spatial_foldmake_spatial_foldsmemmem_multithresholdmoranmoran_multithresholdobjects_sizeoptimization_functionpcapca_multithresholdplot_evaluationplot_importanceplot_moranplot_optimizationplot_residuals_diagnosticsplot_response_curvesplot_response_surfaceplot_training_dfplot_training_df_moranplot_tuningprepare_importance_spatialprint_evaluationprint_importanceprint_moranprint_performancerank_spatial_predictorsrescale_vectorresiduals_diagnosticsresiduals_testrfrf_comparerf_evaluaterf_importancerf_repeatrf_spatialrf_tuningroot_mean_squared_errorselect_spatial_predictors_recursiveselect_spatial_predictors_sequentialsetup_parallel_executionstandard_errorstatistical_modethe_feature_engineerthinningthinning_til_nweights_from_distance_matrix

Dependencies:assertthatbase64enccachemclicodetoolscommonmarkcpp11digestdoParalleldplyrfansifarverfastmapforeachgenericsggplot2gluegridExtragtablehtmltoolshuxtableisobanditeratorslabelinglatticelifecyclemagrittrMatrixmemoisepatchworkpillarpkgconfigpurrrR6rangerRColorBrewerRcppRcppEigenrlangS7scalesstringistringrtibbletidyrtidyselectutf8vctrsviridisviridisLitewithrxml2

Readme and manuals

Help Manual

Help pageTopics
Convert VIF values to data frame.vif_to_df
Area under the ROC curveauc
Multicollinearity reduction via Pearson correlationauto_cor
Multicollinearity reduction via Variance Inflation Factorauto_vif
Create a Beowulf cluster for parallel computingbeowulf_cluster
Generate case weights for imbalanced binary datacase_weights
Default distance thresholds for spatial predictorsdefault_distance_thresholds
Double-center a distance matrixdouble_center_distance_matrix
Remove redundant spatial predictorsfilter_spatial_predictors
Extract evaluation metrics from cross-validated modelget_evaluation
Extract variable importance from modelget_importance
Extract local variable importance from modelget_importance_local
Extract Moran's I test results for model residualsget_moran
Extract out-of-bag performance metrics from modelget_performance
Extract fitted predictions from modelget_predictions
Extract model residualsget_residuals
Extract response curve data for plottingget_response_curves
Extract spatial predictors from spatial modelget_spatial_predictors
Check if variable is binary with values 0 and 1is_binary
Create spatially independent training and testing foldsmake_spatial_fold
Create multiple spatially independent training and testing foldsmake_spatial_folds
Compute Moran's Eigenvector Maps from distance matrixmem
Compute Moran's Eigenvector Maps across multiple distance thresholdsmem_multithreshold
Moran's I test for spatial autocorrelationmoran
Moran's I test across multiple distance thresholdsmoran_multithreshold
Display sizes of objects in current R environmentobjects_size
Compute optimization scores for spatial predictor selectionoptimization_function
Compute Principal Component Analysispca
Compute Principal Component Analysis at multiple distance thresholdspca_multithreshold
Plant richness and predictors for American ecoregionsplants_df
Distance matrix between ecoregion edgesplants_distance
Predictor variable names for plant richness examplesplants_predictors
Response variable name for plant richness examplesplants_response
Example fitted random forest modelplants_rf
Example fitted spatial random forest modelplants_rf_spatial
Coordinates for plant richness dataplants_xy
Visualize spatial cross-validation resultsplot_evaluation
Visualize variable importance scoresplot_importance
Plots a Moran's I test of model residualsplot_moran
Optimization plot of a selection of spatial predictorsplot_optimization
Plot residuals diagnosticsplot_residuals_diagnostics
Plots the response curves of a model.plot_response_curves
Plots the response surfaces of a random forest modelplot_response_surface
Scatterplots of a training data frameplot_training_df
Moran's I plots of a training data frameplot_training_df_moran
Plots a tuning object produced by 'rf_tuning()'plot_tuning
Prepares variable importance objects for spatial modelsprepare_importance_spatial
Prints cross-validation resultsprint_evaluation
Prints variable importanceprint_importance
Prints results of a Moran's I testprint_moran
print_performanceprint_performance
Custom print method for random forest modelsprint.rf
Ranks spatial predictorsrank_spatial_predictors
Rescales a numeric vector into a new rangerescale_vector
Normality test of a numeric vectorresiduals_diagnostics
Normality test of a numeric vectorresiduals_test
Random forest models with Moran's I test of the residualsrf
Compares models via spatial cross-validationrf_compare
Evaluates random forest models with spatial cross-validationrf_evaluate
Contribution of each predictor to model transferabilityrf_importance
Fits several random forest models on the same datarf_repeat
Fits spatial random forest modelsrf_spatial
Tuning of random forest hyperparameters via spatial cross-validationrf_tuning
RMSE and normalized RMSEroot_mean_squared_error
Finds optimal combinations of spatial predictorsselect_spatial_predictors_recursive
Sequential introduction of spatial predictors into a modelselect_spatial_predictors_sequential
Setup parallel execution with automatic backend detectionsetup_parallel_execution
Standard error of the mean of a numeric vectorstandard_error
Statistical mode of a vectorstatistical_mode
Suggest variable interactions and composite features for random forest modelsthe_feature_engineer
Applies thinning to pairs of coordinatesthinning
Applies thinning to pairs of coordinates until reaching a given nthinning_til_n
Transforms a distance matrix into a matrix of weightsweights_from_distance_matrix