anomaly | R Documentation |
anomaly()
calculates the temperature anomalies compared to a baseline
reference period. Anomalies are the difference between annual temperature
extremes and the average across the baseline period.
If aggregate_stations = TRUE
, anomalies are averaged across all weather stations.
anomaly(x, cutoff, aggregate_stations = FALSE)
x |
Object of class |
cutoff |
Numeric, last year of the baseline period (inclusive). |
aggregate_stations |
Logical, if anomaly should be calculated aggregating data from all weather stations. |
cutoff
must be a character with the date, e.g. "2000-01-01".
A tibble with the anomaly timeseries at the stations.
x <- USC00010655
x <- remove_flagged(x)
cover <- annual_coverage(x)
years <- cover$year[cover$"annual_coverage_tmax" > .99 & cover$"annual_coverage_tmin" > .99]
years <- setdiff(years, 2024)
x$years <- as.numeric(format(x$date, "%Y"))
x <- x[x$years %in% years, ]
a <- annual(x)
anom <- anomaly(a, cutoff = 2012)
plot(anom)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.