R/mermaid_import_get_template_and_options.R
mermaid_import_get_template_and_options.Rd
Get template and field options for MERMAID import
mermaid_import_get_template_and_options(
project,
method,
save,
token = mermaid_token()
)
A way to identify the project(s). Can be project IDs (passed as a character vector directly) or projects resulting from mermaid_get_my_projects
or mermaid_search_my_projects
. Defaults to the projects listed via mermaid_get_default_project
, if available.
Method to get import template and field options for. One of "fishbelt", "benthiclit", "benthicpit", "benthicpqt", "bleaching", or "habitatcomplexity".
Excel file to save template and field options to - .xlsx or xls file. Optional.
API token. Authenticate manually via mermaid_auth
, or automatically when running any project- or user-specific functions (like this one).
if (FALSE) { # \dontrun{
template_and_options <- mermaid_get_my_projects() %>%
head(1) %>%
mermaid_import_get_template_and_options("fishbelt", "fishbelt_template.xlsx")
# ✔ Import template and field options written to fishbelt_template.xlsx
names(template_and_options)
# [1] "Template" "Site *"
# [3] "Management *" "Sample date: Year *"
# [5] "Sample date: Month *" "Sample date: Day *"
# [7] "Sample time" "Depth *"
# [9] "Transect number *" "Transect label"
# [11] "Transect length surveyed *" "Width *"
# [13] "Fish size bin *" "Reef slope"
# [15] "Visibility" "Current"
# [17] "Relative depth" "Tide"
# [19] "Sample unit notes" "Observer emails *"
# [21] "Fish name *" "Size *"
# [23] "Count *"
template_and_options[["Template"]]
# A tibble: 0 × 22
# … with 22 variables: Site * <chr>, Management * <chr>, Sample date: Year * <chr>,
# Sample date: Month * <chr>, Sample date: Day * <chr>, Sample time <chr>, Depth * <chr>,
# Transect number * <chr>, Transect label <chr>, Transect length surveyed * <chr>,
# Width * <chr>, Fish size bin * <chr>, Reef slope <chr>, Visibility <chr>, Current <chr>,
# Relative depth <chr>, Tide <chr>, Sample unit notes <chr>, Observer emails * <chr>,
# Fish name * <chr>, Size * <chr>, Count * <chr>
template_and_options[["Reef slope"]][["required"]]
# [1] FALSE
template_and_options[["Reef slope"]][["choices"]]
# A tibble: 4 × 1
# value
# <chr>
# 1 crest
# 2 flat
# 3 slope
# 4 wall
} # }