View source: R/export_geoclim_dekad.R
export_geoclim_dekad | R Documentation |
export_geoclim_dekad
takes a data frame that is given by
by dekad. This data frame is then rearranged using prepare_geoclim_dekad
to a
format suitable for use in GeoCLIM, and then written to a file or connection.
export_geoclim_dekad(
data,
year,
dekad,
element,
metadata = NULL,
join_by = NULL,
station_id,
latitude,
longitude,
add_cols = NULL,
file_path = paste0("GEOCLIM-", element, ".csv"),
...
)
data |
|
year |
|
dekad |
|
element |
|
metadata |
|
join_by |
|
station_id |
|
latitude |
|
longitude |
|
add_cols |
|
file_path |
|
... |
Other parameters passed to |
Invisibly returns the file path of the saved data.
# Calculate dekadal summaries for the rainfall column
dekad_data <- daily_niger %>% dplyr::mutate(dekad = dekad(date))
# Summarise the data
summary_data <- dekad_data %>% dplyr::group_by(station_name, year, dekad) %>%
dplyr::summarise(mean_rain = mean(rain, na.rm = TRUE))
# NOT RUN: Export the data to CSV format
#export_geoclim_dekad(data = summary_data, year = "year",
# station_id = "station_name",
# dekad = "dekad",
# element = "mean_rain", metadata = stations_niger,
# join_by = "station_name",
# latitude = "lat", longitude = "long")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.