pa_apportion_mass: Impose a regular grid over yield polygons

View source: R/yield_monitor.R

pa_apportion_massR Documentation

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
)

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

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.

Value

sf object

Author(s)

Caio dos Santos and Fernando Miguez

Examples


## for examples, see vignette pacu



pacu documentation built on June 8, 2025, 10:44 a.m.