Skip to contents

Statistics can be from either two time periods: 2046 - 2065 and 2081 - 2100 and are all given in units relative to a control period: 1961 - 2000. Derived statistics can be any of the following:

StatisticDescriptionUnits
tmin_meansAverage daily minimum temperaturedegrees Celsius
tmax_meansAverage daily maximum temperaturedegrees Celsius
tmax_days90thNumber of days with maximum temperature above the control period 90th percentile (hot days)days
tmin_days90thNumber of days with minimum temperature above the control period 90th percentile (warm nights)days
tmax_days10thNumber of days with maximum temperature below the control period 10th percentile (cool days)days
tmin_days10thNumber of days with minimum temperature below the control period 10th percentile (cold nights)days
tmin_days0Number of days with minimum temperature below 0 degrees Celsiusdays
ppt_daysNumber of days with precipitation greater than 0.2 mmdays
ppt_days2Number of days with precipitation greater than 2 mmdays
ppt_days10Number of days with precipitation greater than 10 mmdays
ppt_days90thNumber of days with precipitation greater than the control periods 90th percentiledays
ppt_dryspellAverage number of days between precipitation eventsdays
ppt_meansAverage daily precipitationmm

Usage

get_ensemble_stats(locator, type, stat)

Arguments

locator

The ISO3 country code that you want data about. (http://unstats.un.org/unsd/methods/m49/m49alpha.htm) or the basin ID [1-468]

type

the type of data you want "mavg" for monthly averages, "annualavg"

stat

The statistics of interest, must be one of the ones listed above.

Examples

if (FALSE) {
 ### Request data on the US for days of rain over 2 mm
 ens_dat <- get_ensemble_stats("USA","mavg","ppt_days2")
 # subset to the 50th percentile and just until the year 2100
 ens_dat <- subset(ens_dat, ens_dat$percentile == 50)
 ens_dat <- subset(ens_dat,ens_dat$toYear == 2100)
 ggplot(ens_dat,aes(x = as.factor(month), y= monthVals, group=scenario, 
 colour=scenario)) + geom_point() + geom_line()
}