changeEatoRH: Changes Ea values to RH in a CRHM data frame

View source: R/changeEatoRH.R

changeEatoRHR Documentation

Changes Ea values to RH in a CRHM data frame

Description

This function converts values of Ea to RH. Note that the specified obs data frame must contain both Ea and air temperatures. For safety, CRHMr does not permit values of both RH and Ea in a data frame. The names of the variables containing air temperature and ea values must be of the form t.x and ea.x, respectively, where x is an number, even if the column numbers are specified.

Usage

changeEatoRH(obs, t.cols = 1, ea.cols = 1, quiet = TRUE, logfile = "")

Arguments

obs

Required. A CRHMr data frame of observations.

t.cols

Optional. A vector containing the column numbers (not including the datetime) holding the air temperatures. If no columns are specified then the locations of the temperatures are guessed from the column names. The air temperatures must be in ^\circC.

ea.cols

Optional. A vector containing the column numbers (not including the datetime) holding the vapour pressures. If no columns are specified then the locations of the vapour pressures are guessed from the column name. The ea values must be in kPa.

quiet

Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave quiet=TRUE (i.e. the default). If you are working interactively, you will probably want to set quiet=FALSE.

logfile

Optional. Name of the file to be used for logging the action. Normally not used.

Value

If successful, the function returns the original data frame with the ea columns converted to RH values in perceent. If unsuccessful, it returns the value FALSE.

Author(s)

Kevin Shook

See Also

changeRHtoEa

Examples

# First, convert RH values to Ea
BadLake7376.ea <- changeRHtoEa(BadLake7376)
# now convert Ea values back to RH
BadLake7376.rh <- changeEatoRH(BadLake7376.ea)

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.