# Example 1 : Heat Index (fun = NULL)
temp <- array(runif(6, min = 290, max = 315), dim = c(time = 2, member = 3, region = 1)) # K
rh <- array(runif(6, min = 40, max = 90), dim = c(time = 2, member = 3, region = 1)) # %
HI <- HeatIndex(temp = temp, rh = rh, temp_units_input = "Kelvin",
temp_units_output = "Celsius", fun = NULL)
HI
# Example 2 : mean Heat Index (fun = mean by default) ---
temp2 <- array(runif(90, min = 290, max = 315), dim = c(time = 10, lat = 3, lon = 3))
rh2 <- array(runif(90, min = 40, max = 90), dim = c(time = 10, lat = 3, lon = 3))
HI_mean <- HeatIndex(temp = temp2, rh = rh2, temp_units_input = "Kelvin",
temp_units_output = "Celsius", fun = mean, time_dim = "time")
HI_mean
Run the code above in your browser using DataLab