R/bromeliad_inverts_measurements.R

Defines functions bromeliad_inverts_measurements

Documented in bromeliad_inverts_measurements

#' Read the `bromeliad_inverts_measurements` dataset
#'
#' Reads the  `bromeliad_inverts_measurements` dataset, a compilation of real invertebrate
#' body size (mm) and body mass (mg) measurements from bromeliad communities. If you use the
#' data outside the package, please cite the package.
#'
#' @return A tibble with real body length and body size measurements from bromeliad invertebrates.
#' It contains columns for taxonomy ("phylum" to "species"), "stage", "abundance", "body_size_mm",
#' "body_mass_mg", "mass_type" (dry/wet), "data_providers" and "note".
#' @examples
#' # The measurements the package ships with
#' bromeliad_inverts_measurements()
#' @export
bromeliad_inverts_measurements <- function() {

  # Locate the dataset shipped with the package
  path <-
    system.file("extdata", "bromeliad_inverts_measurements.csv",
                package = "hellometry",
                mustWork = TRUE)

  # Read it and return as a tibble
  tibble::as_tibble(
    utils::read.csv(path,
                    check.names = FALSE,
                    fileEncoding = "UTF-8",
                    stringsAsFactors = FALSE))

}

Try the hellometry package in your browser

Any scripts or data that you put into this service are public.

hellometry documentation built on Nov. 11, 2026, 5:06 p.m.