Description Usage Arguments Details Examples
This function computes anomalies with respect to a given reference period. For the function to work, the reference period must be fully in the time series provided.
1 2 |
x |
object of type NetCDF |
anomaly |
start and end year of reference period |
relative |
logical, should relative anomalies (in percent) be computed? |
na.thresh |
minimum fraction of non-missing values in reference period |
rel.thresh |
if relative anomalies larger than rel.thresh occur, no relative anomalies for this time series is computed |
zero.thresh |
maximum fraction of zeroes in reference period (see details) |
If relative anomalies are computed, both rel.thresh
and zero.thresh
can be used to deal with cases for which the reference period climatology is close
to zero. rel.thresh
masks all seasonal time series for which there is at least
one relative anomaly larger than the indicated threshold. zero.thresh
on the
other hand uses the fraction of zeroes in the reference period, and masks seasonal
time series with more than the indicated fraction of zeroes in the reference period
as missing. For example, if set to 1 (the default), only time series with a reference
climatology of zero (all values equal zero in the reference period) will be masked.
1 2 3 4 5 6 7 8 | tas <- readNetCDF(system.file("extdata", "annual_CRUTEMv3_1961-90.nc", package="geoutils"), varname="temp")
## compute anomalies wrt first year of series
tasanom <- anomalies(tas, c(1961,1961))
## get a grid point with many obs
si <- which.max(apply(!is.na(tasanom), 1, sum))
## plot time series of anomalies
plot(tasanom, type='ts', si=si)
abline(h=0, lty=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.