calculate_representation {sgsR}R Documentation

Compare sample representation within sraster strata

Description

Compare sample representation within sraster strata

Usage

calculate_representation(sraster, existing, drop = NULL, plot = FALSE)

Arguments

sraster

spatRaster. Stratification raster.

existing

sf 'POINT'. Existing plot network.

drop

Numeric. Numeric value between 0-1 representing the sraster frequency (srasterFreq) below which strata will be dropped from comparison (e.g.. This parameter can be useful for when comparing stratum where percent coverage of strata may be ~ 0 percent and should be dropped. This could occur when mapping multiple stratifications.

plot

Logical. Plot frequency of strata coverage and sampling coverage for sraster and existing. Will return a list if TRUE.

Details

Calculate how sraster strata are represented in existing samples

Value

Returns a tibble where:

Author(s)

Tristan R.H. Goodbody, Martin Queinnec

See Also

Other calculate functions: calculate_allocation(), calculate_allocation_existing(), calculate_coobs(), calculate_distance(), calculate_pcomp(), calculate_pop(), calculate_sampsize()

Examples

### --- generate example stratification ---###

#--- load ALS metrics from sgsR internal data ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")

#--- read ALS metrics using the terra package ---#
mraster <- terra::rast(r)

#--- perform stratification ---#
sraster <- strat_kmeans(
  mraster = mraster$zq90,
  nStrata = 6
)

### --- create existing sample network ---###

#--- simple random sampling ---#
existing <- sample_srs(
  raster = mraster$zq90,
  nSamp = 100
)

#--- calculate representation ---#

calculate_representation(
  sraster = sraster,
  existing = existing
)

[Package sgsR version 1.4.5 Index]