Learn R Programming

weathermetrics (version 1.2.2)

dewpoint.to.humidity: Calculate relative humidity.

Description

dewpoint.to.humidity creates a numeric vector of relative humidity from numerical vectors of air temperature and dew point temperature.

Usage

dewpoint.to.humidity(dp = NA, t = NA, temperature.metric = "fahrenheit")

Arguments

dp
Numeric vector of dew point temperatures.
t
Numeric vector of air temperatures.
temperature.metric
Character string indicating the temperature metric of air temperature and dew point temperature. Possible values are fahrenheit or celsius.

Value

A numeric vector of relative humidity (in %)

Details

Dew point temperature and temperature must be in the same metric (i.e., either both in Celsius or both in Fahrenheit). If necessary, use convert_temperature to convert before using this function.

References

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.

See Also

humidity.to.dewpoint, fahrenheit.to.celsius, celsius.to.fahrenheit, convert_temperature

Examples

Run this code
# Calculate relative humidity from air temperature and
# dew point temperature.

data(lyon)
lyon$RH <- dewpoint.to.humidity(t = lyon$TemperatureC,
                                dp = lyon$DewpointC,
                                temperature.metric = 'celsius')
lyon

Run the code above in your browser using DataLab