Prints the results of a Moran's I test on the residuals of a model.

print_moran(
  model,
  caption = NULL,
  verbose = TRUE
)

Arguments

model

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

caption

Character, caption of the output table, Default: NULL

verbose

Logical, if TRUE, the resulting table is printed into the console, Default: TRUE

Value

Prints a table in the console using the huxtable package.

Examples

if(interactive()){

 #loading example data
 data(plant_richness_df)
 data(distance.matrix)

 #fitting 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
 )

 #printing Moran's I of model's residuals
 print_moran(rf.model)

}