Learn R Programming

paar (version 1.0.1)

compare_zone: Compare spatial zone means

Description

Compare spatial zone means

Usage

compare_zone(
  data,
  variable,
  zonesCol,
  alpha = 0.05,
  join = sf::st_nearest_feature,
  returnLSD = FALSE,
  grid_dim
)

Value

list with differences and descriptive_stat

Arguments

data

sf object with zones

variable

character or sf object to use for mean comparison

zonesCol

character colname from data were zone are specified

alpha

numeric Significance level to use for comparison

join

function to use for st_join if variable is sf object

returnLSD

logical when LSD calculates with spatial variance should be returned

grid_dim

numeric grid dimentins to estimate spatial variance

References

Paccioretti, P., Córdoba, M., & Balzarini, M. (2020). FastMapping: Software to create field maps and identify management zones in precision agriculture. Computers and Electronics in Agriculture, 175, 105556 https://doi.org/10.1016/j.compag.2020.105556.

Examples

Run this code
library(sf)
data(wheat, package = "paar")

##Convert to an sf object
wheat <- sf::st_as_sf(wheat,
                      coords = c("x", "y"),
                      crs = 32720)
clusters <- paar::kmspc(
  wheat,
  variables = c('CE30', 'CE90', 'Elev', 'Pe', 'Tg'),
  number_cluster = 3:4
)
data_clusters <- cbind(wheat, clusters$cluster)
compare_zone(data_clusters,
             "Elev",
             "Cluster_3")

Run the code above in your browser using DataLab