View source: R/export_cdt_dekad.R
export_cdt_dekad | R Documentation |
export_cdt_dekad
takes a data frame that has elements summarised
by dekad. This data frame is then rearranged using prepare_cdt_dekad
to a
format suitable for use in CDT, and then written to a file or connection.
export_cdt_dekad(
data,
station,
element,
date_time,
latitude,
longitude,
altitude,
year = NULL,
month = NULL,
dekad = NULL,
metadata = NULL,
file_path = paste0("CDT-", element, ".csv"),
...
)
data |
|
station |
|
element |
|
date_time |
|
latitude |
|
longitude |
|
altitude |
|
year |
|
month |
|
dekad |
|
metadata |
|
file_path |
|
... |
Other parameters passed to |
Invisibly returns the file path of the saved data
# To write daily_niger data to CDT format
# first put daily_niger data into a dekad format
data(daily_niger)
summary_data <- daily_niger %>%
dplyr::mutate(dekad_date = dekad(daily_niger$date)) %>%
dplyr::group_by(station_name, year, dekad_date) %>%
dplyr::summarise(date = dplyr::first(date), sum = sum(tmax))
# NOT RUN:
#export_cdt_dekad(data = daily_niger, station = "station_name", element = "rain",
# date_time = "date", latitude = "lat", longitude = "long", altitude = "alt",
# metadata = stations_niger)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.