get_moran: Gets Moran's I test of model residuals

View source: R/get_moran.R

get_moranR Documentation

Gets Moran's I test of model residuals

Description

Returns the Moran's I test on the residuals of a model produced by rf(), rf_repeat(), or rf_spatial().

Usage

get_moran(model)

Arguments

model

A model fitted with rf(), rf_repeat(), or rf_spatial()

Value

A data frame with Moran's I test results produced by moran_multithreshold().

See Also

moran(), moran_multithreshold(), plot_moran(), print_moran().

Examples

if(interactive()){

 #loading example data
 data(plant_richness_df)
 data(distance_matrix)

 #fitting a random forest model
 rf.model <- rf(
   data = plant_richness_df,
   dependent.variable.name = "richness_species_vascular",
   predictor.variable.names = colnames(plant_richness_df)[5:21],
   distance.matrix = distance_matrix,
   distance.thresholds = c(0, 1000, 2000),
   n.cores = 1,
   verbose = FALSE
 )

 #getting Moran's I of the residuals
 x <- get_moran(rf.model)

}

spatialRF documentation built on Aug. 19, 2022, 5:23 p.m.