Description Usage Arguments Details Value Note Author(s) References Examples
heat_index
converts a numeric scalar of temperature
(in Fahrenheit) and a numeric scalar of relative humidity (in %)
to heat index (in Fahrenheit). This function is not meant to be used
outside of the heat.index()
function.
1 2 3 4 5 6 7 | heat_index(t, rh)
heat_index_julia(t, rh)
heat.index(t = NA, rh = NA)
heat_index_vec(t = NA, rh = NA)
|
t |
Numeric scalar of air temperature, in celsius. |
rh |
Numeric scalar of relative humidity, in %. |
If an impossible value of relative humidity is given
(below 0% or above 100%), heat index is returned as NA
.
A numeric scalar of heat index, in celsius
Equations are from the source code for the US National Weather Service's online heat index calculator.
Brooke Anderson brooke.anderson@colostate.edu, Roger Peng rdpeng@gmail.com
Anderson GB, Bell ML, Peng RD. 2013. Methods to calculate the heat index as an exposure Metric in environmental health research. Environmental Health Perspectives 121(10):1111-1119.
National Weather Service Hydrometeorological Prediction Center Web Team. Heat Index Calculator. 30 Jan 2015. http://www.wpc.ncep.noaa.gov/html/heatindex.shtml. Accessed 18 Dec 2015.
Rothfusz L. 1990. The heat index (or, more than you ever wanted to know about heat index) (Technical Attachment SR 90-23). Fort Worth: Scientific Services Division, National Weather Service.
R. Steadman, 1979. The assessment of sultriness. Part I: A temperature-humidity index based on human physiology and clothing science. Journal of Applied Meteorology, 18(7):861–873.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | n <- 1e3
t <- seq(-10, 50, length.out = n)
rh <- seq(0.1, 1, length.out = length(t))
## bug exist
# i <- 88
heat_index(t[i], rh[i])
heat_index_julia(t[i], rh[i])
heat_index_vec(t[i], rh[i])
r2 <- heat_index(t, rh)
r1 <- heat_index_julia(t, rh)
r_vec <- heat_index_vec(t, rh)
julia_setup()
# add tests for julia NA values
r1 <- heat_index_julia(t*NA, rh*NA)
all.equal(r1, r2)
all.equal(r1, r_vec)
microbenchmark::microbenchmark(
r2 <- heat_index(t, rh),
r1 <- heat_index_julia(t, rh),
r_vec <- heat_index_vec(t, rh)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.