Learn R Programming

pacu (version 0.1.74)

pa_apportion_mass: Impose a regular grid over yield polygons

Description

Impose a regular grid over yield polygons

Usage

pa_apportion_mass(
  polygons,
  mass.vector,
  cell.size = NULL,
  sum = FALSE,
  remove.empty.cells = TRUE,
  cores = 1L,
  verbose = FALSE
)

Value

sf object

Arguments

polygons

sf object containing polygon geometries

mass.vector

a vector of mass observations

cell.size

optional numerical value (length 1) to be used as the width and height of the grid

sum

whether the apportioned values should be added together. This is useful in the case of overlaping polygons that have an additive effect. For example, polygons representing seeding rates.

remove.empty.cells

logical. Whether to remove empty cells, with NA values.

cores

the number of cores used in the operation

verbose

whether to print operation details

Author

Caio dos Santos and Fernando Miguez

Details

This function will impose a regular grid over the yield polygons and compute the weighted average of the mass value represented by each polygon. The averages are weighted according to the polygon area.

Examples

Run this code
# \donttest{
## for examples, see vignette pacu
# }

Run the code above in your browser using DataLab