dataset_id import location data from a dataframeR/setup.R
metadata_add_locations.RdThis functions asks users which columns in the dataframe they would like to keep and records this appropriately in the metadata. The input data is assumed to be in wide format. The output may require additional manual editing.
metadata_add_locations(
dataset_id,
location_data,
user_responses = NULL,
file = NULL
)Identifier for a particular study in the database
A dataframe of site variables
Named list containing simulated user input for manual selection of variables, mainly for testing purposes
Name of a csv file to hold the locations, written beside
metadata.yml and referred to from it as locations: <file>, instead of
listing every location in the yaml. Worth using for a dataset with many
locations, such as one generating a location per georeferenced record.
if (FALSE) { # \dontrun{
austraits$locations %>% dplyr::filter(dataset_id == "Falster_2005_1") %>%
select(-dataset_id) %>% spread(location_property, value) %>% type_convert() -> location_data
metadata_add_locations("Falster_2005_1", location_data)
metadata_add_locations("AVH_2026", location_data, file = "locations.csv")
} # }