View source: R/prepare_geoclim.R
prepare_geoclim | R Documentation |
prepare_geoclim
rearranges a data frame to a
format suitable for use in GeoCLIM. This data frame can be rearranged and
exported to a file or connection with export_geoclim
.
prepare_geoclim(
data,
year,
type_col,
element,
station_id,
latitude,
longitude,
type = c("dekad", "pentad"),
metadata = NULL,
join_by = NULL,
add_cols = NULL
)
data |
|
year |
|
type_col |
|
element |
|
station_id |
|
latitude |
|
longitude |
|
type |
|
metadata |
|
join_by |
|
add_cols |
|
A data.frame formatted for use in GeoCLIM
# Calculate dekadal summaries for the rainfall column
dekad_data <- daily_niger %>% dplyr::mutate(dekad = dekad(date))
summary_data <- dekad_data %>% dplyr::group_by(station_name, year, dekad) %>%
dplyr::summarise(mean_rain = mean(rain, na.rm = TRUE))
prepare_geoclim(data = summary_data, year = "year",
station_id = "station_name",
type_col = "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.