Calculates invertebrate mass (kg) based on field acreage. Requires input of the fields data frame with area_ac attribute. Returns the data frame with additional columns for calculated values. Can be chained with pipes.

ff_calc_inv_mass(df, day)

Arguments

df

An sf dataset, such as the provided dataframe ff_fields, which includes an attribute area_ac containing the field area in acres. Also works with an ordinary data.frame or tibble.

day

The day number for which to calculate the invertebrate mass. If not provided, then only a daily mass is calculated.

Examples

# calculate the invertebrate mass after 14 days for each field
ff_fields |> ff_calc_inv_mass(14)
#> Simple feature collection with 9628 features and 9 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 6478160 ymin: 1939404 xmax: 6762226 ymax: 2383039
#> Projected CRS: NAD83(2011) / California zone 2 (ftUS)
#> # A tibble: 9,628 × 10
#>    unique_id county elev_grp                           geometry group_id area_ac
#>  * <chr>     <chr>  <chr>            <POLYGON [US_survey_foot]> <chr>      <dbl>
#>  1 1103539   Glenn  90 to 100  ((6526707 2289953, 6526695 2289… 1802010…   23.4 
#>  2 1102849   Glenn  110 to 120 ((6517766 2307611, 6517767 2306… 1802010…   23.5 
#>  3 1103353   Glenn  120 to 130 ((6501679 2309168, 6501671 2309… 1802010…    1.06
#>  4 1103425   Glenn  120 to 130 ((6525986 2324730, 6525994 2324… 1802010…    1.34
#>  5 1103546   Glenn  70 to 80   ((6535820 2277869, 6535868 2277… 1802010…   48.9 
#>  6 1103560   Glenn  90 to 100  ((6499898 2267008, 6499909 2267… 1802010…   15.1 
#>  7 1103561   Glenn  90 to 100  ((6505757 2270476, 6504556 2270… 1802010…   34.7 
#>  8 1103563   Glenn  100 to 110 ((6544553 2330567, 6544584 2330… 1802010…   24.9 
#>  9 1103564   Glenn  120 to 130 ((6529293 2334151, 6529890 2334… 1802010…   74.7 
#> 10 1103566   Glenn  100 to 110 ((6551712 2337179, 6552789 2337… 1802010…   56.0 
#> # ℹ 9,618 more rows
#> # ℹ 4 more variables: volume_af <dbl>, area_m2 <dbl>, daily_prod_kg <dbl>,
#> #   total_prod_kg <dbl>