Skip to contents

Once data conform to Darwin Core Standard, use_data() makes it easy to save data in the correct place for building a Darwin Core Archive with build_archive().

use_data() is an all-in-one function for accepted data types "occurrence", "event" and "multimedia". use_data() attempts to detect and save the correct data type based on the provided tibble/data.frame. Alternatively, users can call the underlying functions use_data_occurrences() or use_data_events() to specify data type manually.

Usage

use_data(..., overwrite = FALSE, quiet = FALSE)

use_data_occurrences(df, overwrite = FALSE, quiet = FALSE)

use_data_events(df, overwrite = FALSE, quiet = FALSE)

Arguments

...

Unquoted name of tibble/data.frame to save.

overwrite

By default, use_data_events() will not overwrite existing files. If you really want to do so, set this to TRUE.

quiet

Whether to message about what is happening. Default is set to FALSE.

df

A tibble/data.frame to save.

Value

Does not return anything to the workspace; called for the side-effect of saving a .csv file to /data-publish.

Details

This function saves data in the data-publish folder. It will create that folder if it is not already present.

Data type is determined by detecting type-specific column names in supplied data.

  • Event: (eventID, parentEventID, eventType)

  • Multimedia: not yet supported

See also

Examples

if (FALSE) { # \dontrun{
df <- tibble::tibble(
  occurrenceID = c("a1", "a2"),
  species = c("Eolophus roseicapilla", "Galaxias truttaceus"))
  
use_data(df)
} # }