Skip to contents

Different agencies and species programs use different names for the same demographic categories (e.g., "Cows" vs "Females", "Calves" vs "Fawns"). Column mappings bridge this gap by linking a standard internal database column name (name) to the agency's preferred display label (display).

Usage

sight_read_survey_cols(
  species = NULL,
  survey_type = NULL,
  name = NULL,
  display = NULL,
  filter_species = TRUE,
  filter_survey_type = TRUE,
  sort = NULL,
  pages = list(omit = 1),
  includes = NULL,
  ...
)

sight_read_survey_cols_id(
  id = NULL,
  survey_type_id = NULL,
  name = NULL,
  display = NULL,
  sort = NULL,
  pages = list(omit = 1),
  includes = NULL,
  dry_run = FALSE,
  ...
)

Arguments

species

The name of the species to filter by, required when survey_type is supplied

survey_type

The name of the survey type to filter by

name

the name of the survey column

display

the display name of the survey column

filter_species

logical. Has no effect for column mappings (the endpoint does not filter by species). Included for interface consistency; species is always used only for lookup context.

filter_survey_type

logical, if FALSE survey_type is only used for lookup context and not passed as a filter (default TRUE)

sort

a character vector of fields to sort by, see details

pages

a list of pagination options, see details

includes

a character vector of related resources to include, see details

...

Additional arguments passed to the underlying spdgt.auth function (e.g., verbosity, timeout).

id

the unique identifier of the mapping

survey_type_id

the unique identifier of the survey type

dry_run

If TRUE, print the HTTP request without sending it and return the request object invisibly. Useful for debugging.

Value

A tibble defining demographic column mappings for a survey type:

id

Integer. Unique identifier for the column mapping.

survey_type_id

Integer. Associated survey type.

name

Character. Internal column name (e.g., "total", "males", "females", "youngs", "unclass"). Used for programmatic access.

display

Character. Human-readable display name (e.g., "Total Elk", "Cows", "Calves"). Varies by species and agency.

Details

The pages argument is a named list with the following options:

  • omit: page number to omit, default is 1 which returns all records

  • size: number of records to return

  • number: the page number to return given the size

The includes argument is a character vector of related resources to include. Valid values are:

  • surveyType: include survey type details

The sort argument is a named list where names are fields to sort by.

The name is the database's internal name for the column whereas the display name is the chosen name for display purposes.

See also

lkup_survey_type_id() for converting survey type names to IDs

Examples

if (FALSE) { # \dontrun{
# Read all survey column mappings
sight_read_survey_cols()

# Read survey column mapping by ID
sight_read_survey_cols(id = 1)

# Read survey column mappings for a survey type ID
sight_read_survey_cols(survey_type_id = 1)
} # }