
Last chance! 50% off unlimited learning
Sale ends in
Get daily maximum and minimum temperature data from the "Climate Hazards Group". CHIRTS-daily is a global 2-m temperature product that combines the monthly CHIRTSmax data set with the ERA5 reanalysis to produce routinely updated data to support the monitoring of temperature extreme. Data is currently available from 1983 to 2016. Soon available to near-present.
get_chirts(object, dates, var, ...)# S3 method for default
get_chirts(object, dates, var, as.matrix = FALSE, ...)
# S3 method for SpatVector
get_chirts(object, dates, var, as.raster = TRUE, ...)
# S3 method for SpatRaster
get_chirts(object, dates, var, as.raster = TRUE, ...)
A SpatRaster object if as.raster=TRUE
, else matrix
,
list
, or data.frame
interval: supported intervals are “daily”, “pentad”, “dekad”, “monthly”, “2-monthly”, “3-monthly”, and “annual”. Currently hard coded to “daily”.
Variable description from https://data.chc.ucsb.edu/products/CHIRTSdaily/aaa.Readme.txt
Daily average maximum air temperature at 2 m above ground
Daily average minimum air temperature at 2 m above ground
Daily average relative humidity
Daily average heat index
# NOT RUN {
library("chirps")
library("terra")
# Case 1: input a data frame return a data frame in the long format
dates <- c("2010-12-15","2010-12-31")
lonlat <- data.frame(lon = c(-55.0281,-54.9857),
lat = c(-2.8094, -2.8756))
temp1 <- get_chirts(lonlat, dates, var = "Tmax")
# Case 2: input a data frame return a matrix
temp2 <- get_chirts(lonlat, dates, "Tmax", as.matrix = TRUE)
# Case 3: input a raster and return raster
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
temp3 <- get_chirts(v, dates, var = "Tmax", as.raster = TRUE)
# Case 4: input a raster and return raster
temp4 <- get_chirts(v, dates, var = "Tmax", as.matrix = TRUE)
# }
Run the code above in your browser using DataLab