wd <- data.frame(date=as.Date("2003-08-28") + 1:3,
temp=c(19.1, 20.6, 19.4),
rhum=c(66,71,73),
wind=c(3.3, 1.9, 1.1),
srad=c(168, 178, 125))
Tg(wd, 40.96)
Tnwb(wd, 40.96)
WBGT(wd, 40.96)
library(terra)
r <- rast(ncol=2, nrow=2, nlyr=1)
temp <- setValues(r, 21:24)
time(temp) <- as.Date("2000-01-01")
rhum <- setValues(r, 81:84)
wind <- setValues(r, 9:12)
srad <- setValues(r, 100:103)
s <- sds(list(temp=temp, rhum=rhum, wind=wind, srad=srad))
x <- Tg(s)
y <- WBGT(s)
Run the code above in your browser using DataLab