Description Usage Arguments Details Value Examples
"Widens" monthly long form data form and calculates
yearly average counts for Jan:Dec and
seasonal average counts mean data/month
seasons are Dec-Feb (DJF), Mar-May (MAM), June-Aug (JJA), Sept-Nov (SON)
Winter: year refers to January (realized by lag()).
note for Precipitation: to be multiplied by 12 if mm/year is needed
1 | uts_gen_yearly_seasonal_avg(data, season = TRUE)
|
data |
A data frame with monthly "count" in long format |
season |
Logical. If TRUE, the default, seasonal mean will be calculated |
The input data frame must have the column names
City, Measure, Year_Month, Year
and count
and can be also a tibble or tsibble.
data frame and tibble (not a tsibble), e.g.:
A tibble: 10 x 8
Groups: City, Measure [2]
# here: Measure = Temperature and Precipitation
City Measure Year Winter_avg Spring_avg Summer_avg Fall_avg Year_avg
<chr> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 2 3 4 5 | # Temperature and Precipitation data of "Basel" w/o NAs rsp. Giessen w/ NAs
uts_gen_yearly_seasonal_avg(monthly_climate_basel)
uts_gen_yearly_seasonal_avg(monthly_climate_giessen) # w/ NAs
# note: NAs of Winter_avg does not impact Year_avg if this
# NA is caused by December value of previous year
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.