The climatrends package provides methods to compute precipitation and temperature indices for climate models in ecology. The indices produced here can be used as explanatory variables for ecological modelling, crop modelling, and to assess trends in climate change.
The package may be installed from CRAN via
install.packages("climatrends")
The development version can be installed via
library("remotes")
install_github("agrdatasci/climatrends", build_vignettes = TRUE)
The default method for the function temperature()
has as the basic input one numeric vector
with the maximum temperature and one numeric vector
with the minimum temperature:
library("climatrends")
data("innlandet", package = "climatrends")
temperature(innlandet$tmax, innlandet$tmin)
maxDT minDT maxNT minNT DTR SU TR CFD WSDI CSDI T10p T90p<dbl> <dbl> <dbl> <dbl> <int> <int> <int> <int> <int> <int> <dbl> <dbl>
1: 15.13 -14.86 6.77 -19.25 6 0 0 115 4 5 -15.81 9.09
The indices can be splitted in intervals for series analysis. Here we get the temperature indices with intervals of 30 days.
temperature(innlandet$tmax, innlandet$tmin,
dates = innlandet$day,
timeseries = TRUE,
intervals = 30)
id date index value<int> <date> <chr> <dbl>
1: 1 2019-01-01 maxDT -0.15
2: 1 2019-01-01 minDT -14.86
3: 1 2019-01-01 maxNT -3.41
4: 1 2019-01-01 minNT -18.67
5: 1 2019-01-01 DTR 4.35
---
68: 1 2019-05-31 CFD 3.00
69: 1 2019-05-31 WSDI 2.00
70: 1 2019-05-31 CSDI 3.00
71: 1 2019-05-31 T10p 0.20
72: 1 2019-05-31 T90p 11.14
The full functionality of climatrends is illustrated in the package vignette. The vignette can be found on the package website or from within R
once the package has been installed, e.g. via
vignette("Overview", package = "climatrends")
Package website
Please report any issues or bugs.
License: MIT
Get citation information for climatrends in R by typing citation(package = "climatrends")
.
You are welcome to contribute to the climatrends project. Please read our contribution guide lines.
Please note that the climatrends project is released with a Contributor Code of Conduct. By participating in the climatrends project you agree to abide by its terms.