update_tagexplorer: Update the Google Sheet "Turtle Tag Explorer"

View source: R/update_tagexplorer.R

update_tagexplorerR Documentation

Update the Google Sheet "Turtle Tag Explorer"

Description

This function first authenticates (out of band) against a Google account given through the email Sys.getenv("GOOGLE_MAPS_APIKEY"). Next, selected columns of tagged wastd_data$animals are written over an existing sheet "Encounters" in the Google Sheet with ID Sys.getenv("TURTLE_SHEET"). Lastly, metadata (number of records, data accessed on, data uploaded on) are written to a sheet "Metadata". Messages choose verbosity from wastdr::get_wastdr_verbose().

Usage

update_tagexplorer(
  wastd_data,
  doc_id = Sys.getenv("TURTLE_SHEET"),
  api_key = Sys.getenv("GOOGLE_MAPS_APIKEY")
)

Arguments

wastd_data

The output of wastdr::download_wastd_turtledata()..

doc_id

The Google Sheet ID, default: Sys.getenv("TURTLE_SHEET").

api_key

A Google API key, default: Sys.getenv("GOOGLE_MAPS_APIKEY").

Details

Should the total number of cells exceed the Google Sheet limit of 5M cells, this function aborts with an informative error message.

Value

A list with keys:

  • enc The selected columns and (all) rows of tagged wastd_data$animals.

  • enc_sheet The Google sheet ID for the sheet containing encounters.

  • meta_sheet The Google sheet ID for the sheet containing the metadata.


dbca-wa/etlTurtleNesting documentation built on Nov. 18, 2022, 8:03 a.m.