prepare_existing: Prepare existing sample data

View source: R/utils-existing.R

prepare_existingR Documentation

Prepare existing sample data

Description

This function prepares the existing sample data by ensuring that it meets the necessary requirements for downstream analysis. If the 'existing' object is not of class 'sf', this function checks that the data contains columns named "X" and "Y", and converts lowercase "x" and "y" column names to uppercase if necessary. If the 'raster' object is supplied, this function checks if 'existing' contains attributes with the same names as 'raster'. If it does not, this function extracts metrics at existing sample locations using the 'raster' object. If 'access' is not null, the function masks the existing sample locations with a buffered access area.

Usage

prepare_existing(
  existing,
  raster = NULL,
  access = NULL,
  buff_inner = NULL,
  buff_outer = NULL
)

Arguments

existing

sf 'POINT'. Existing plot network.

raster

SpatRaster. Raster to guide the location of the samples. If type = "clhs" this raster can also be used to define the population distributions to be used for sampling.

access

sf. Road access network - must be lines.

buff_inner

Numeric. Inner buffer boundary specifying distance from access where plots cannot be sampled.

buff_outer

Numeric. Outer buffer boundary specifying distance from access where plots can be sampled.


tgoodbody/sgsR documentation built on March 7, 2024, 2:20 a.m.