set_abundance: Set, create or modify columns with abundance information

View source: R/set_abundance.R

set_abundanceR Documentation

Set, create or modify columns with abundance information

Description

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 or tibble 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)

Value

A tibble with the requested fields added/reformatted.

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)


corella documentation built on April 4, 2025, 12:20 a.m.