In some field methods, it is common to observe more than one individual
per observation; to observe abundance using non-integer measures such as
mass or area; or to seek individuals but not find them (abundance of zero).
As these approaches use different Darwin Core terms, this function assists in
specifying abundances to a tibble
using Darwin Core Standard.
In practice this is no different from using mutate()
, but gives some
informative errors, and serves as a useful lookup for how columns with
abundance information are represented in the Darwin Core Standard.
Usage
set_abundance(
.df,
individualCount = NULL,
organismQuantity = NULL,
organismQuantityType = NULL,
.keep = "unused"
)
Arguments
- .df
A
data.frame
ortibble
that the column should be appended to.- individualCount
The number of individuals present
- organismQuantity
A number or enumeration value for the quantity of organisms. Used together with
organismQuantityType
to provide context.- organismQuantityType
The type of quantification system used for
organismQuantity
.- .keep
Control which columns from .data are retained in the output. Note that unlike
dplyr::mutate()
, which defaults to"all"
this defaults to"unused"
; i.e. only keeps Darwin Core columns, and not those columns used to generate them.
Details
Examples of organismQuantity
& organismQuantityType
values:
27 (
organismQuantity
) individuals (organismQuantityType
)12.5 (
organismQuantity
) % biomass (organismQuantityType
)r (
organismQuantity
) Braun-Blanquet Scale (organismQuantityType
)many (
organismQuantity
) individuals (organismQuantityType
)
Examples
df <- tibble::tibble(
scientificName = c("Cacatua (Licmetis) tenuirostris",
"Cacatua (Licmetis) tenuirostris",
"Cacatua (Licmetis) tenuirostris"),
n_obs = c(1, 3, 4)
)
df |>
set_abundance(individualCount = n_obs)
#> ⠙ Checking 1 column: individualCount
#> ⠹ Checking 1 column: individualCount
#> ✔ Checking 1 column: individualCount [316ms]
#>
#> # A tibble: 3 × 2
#> scientificName individualCount
#> <chr> <dbl>
#> 1 Cacatua (Licmetis) tenuirostris 1
#> 2 Cacatua (Licmetis) tenuirostris 3
#> 3 Cacatua (Licmetis) tenuirostris 4