View source: R/remap_data_names.R
remap_data_names | R Documentation |
Useful to prepare data from several different data sources into a common
structure that can be read collectively via arrow::open_dataset()
remap_data_names(
this_name,
df_to_remap,
data_map = NULL,
out_file = NULL,
exclude_cols = c("order", "epsg", "desc", "data_name_use", "url"),
add_month = !is.null(data_map),
add_year = !is.null(data_map),
add_occ = !is.null(data_map),
occ_cols = c("occ_derivation", "quantity"),
absences = c("0", "none detected", "none observed", "None detected", "ABSENT"),
previous = c("delete", "move"),
compare_previous = TRUE,
compare_cols = c("data_name", "survey"),
...
)
this_name |
Character. Name of the data source. |
df_to_remap |
Dataframe containing the columns to select and (potentially) rename |
data_map |
Dataframe or NULL. Mapping of fields to retrieve. See example
|
out_file |
Character. Name of file to save. If |
add_month , add_year |
Logical. Add a year and/or month column to returned
data frame (requires a |
add_occ |
Logical. Make an |
absences |
Character. If |
previous |
Character. What to do with any previous |
compare_previous |
Logical. If |
compare_cols |
If |
... |
Not used |
exclude_names |
Character. column names in namesmap to exclude from the combined data |
Includes code from the stack exchange network post by Dan.
Tibble with selected, renamed, adjusted and aligned columns
Other Help with combining data sources:
get_data()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.