View source: R/yield_monitor.R
pa_apportion_mass | R Documentation |
Impose a regular grid over yield polygons
pa_apportion_mass(
polygons,
mass.vector,
cell.size = NULL,
sum = FALSE,
remove.empty.cells = TRUE,
cores = 1L,
verbose = FALSE
)
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 |
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.
sf object
Caio dos Santos and Fernando Miguez
## for examples, see vignette pacu
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.