use_data | R Documentation |
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.
use_data(..., overwrite = FALSE, quiet = FALSE)
use_data_occurrences(df, overwrite = FALSE, quiet = FALSE)
use_data_events(df, overwrite = FALSE, quiet = FALSE)
... |
Unquoted name of |
overwrite |
By default, |
quiet |
Whether to message about what is happening. Default is set to
|
df |
A |
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
Does not return anything to the workspace; called for the side-effect
of saving a .csv
file to /data-publish
.
use_metadata()
to save metadata to /data-publish
.
# Build an example dataset
df <- tibble::tibble(
occurrenceID = c("a1", "a2"),
species = c("Eolophus roseicapilla", "Galaxias truttaceus"))
# The default function *always* asks about data type
if(interactive()){
use_data(df)
}
# To manually specify the type of data - and avoid questions in your
# console - use the underlying functions instead
use_data_occurrences(df, quiet = TRUE)
# Check that file has been created
list.files("data-publish")
# returns "occurrences.csv" as expected
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.