Skip to contents

Returns the entry column mapping versions that define how data entry datasheets are configured for a survey type. These control which fields appear in the data entry UI and how raw input is transformed into database columns.

Usage

sight_read_datasheet_cols(
  species = NULL,
  survey_type = NULL,
  active = TRUE,
  is_target_species = TRUE,
  pages = list(omit = 1),
  ...
)

sight_read_datasheet_cols_id(
  survey_type_id = NULL,
  active = TRUE,
  is_target_species = TRUE,
  pages = list(omit = 1),
  dry_run = FALSE,
  ...
)

Arguments

species

The name of the species, required when survey_type is supplied

survey_type

The name of the survey type

active

logical, if TRUE (default) only return active versions

is_target_species

logical, if TRUE (default) only return mappings for the target species

pages

a list of pagination options, see details

...

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

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 of entry column mapping versions with nested column mappings

Details

This is different from sight_read_survey_cols() which returns the estimation column mappings used by the R analysis pipeline. Datasheet columns describe the data entry UI; survey cols describe which DB columns to use for estimation.

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

Each version record may contain nested column_mappings which describe individual field transformations (source, mapped, operation, display).

Note: Some projects have NULL species_id in their version records, which causes parse_json2tibble() schema validation to fail. This function uses parse_json2list() as a fallback and converts to a tibble manually.

See also

sight_read_survey_cols() for estimation column mappings

Examples

if (FALSE) { # \dontrun{
# Read datasheet columns for a survey type
sight_read_datasheet_cols(
  species = "Elk",
  survey_type = "Structured-Abundance"
)

# By survey type ID
sight_read_datasheet_cols_id(survey_type_id = 22L)
} # }