changeRHtoEa: Changes RH values to Ea in a CRHM dataframe

View source: R/changeRHtoEa.R

changeRHtoEaR Documentation

Changes RH values to Ea in a CRHM dataframe

Description

This function converts values of RH to Ea. CRHMr does not allow interpolation or imputation of RH values, so you must convert RH values to Ea before infilling. Note that the specified obs dataframe must contain both RH 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 RH values must be of the form t.x and rh.x, respectively, where x is an number, even if the column numbers are specified.

Usage

changeRHtoEa(obs, t.cols = 1, rh.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.

rh.cols

Optional. A vector containing the column numbers (not including the datetime) holding the relative humidities. If no columns are specified then the locations of the RH values are guessed from the column names.

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 RH columns converted to ea values in kPa. If unsuccessful, it returns the value FALSE.

Author(s)

Kevin Shook

See Also

changeEatoRH

Examples

BadLake7376.ea <- changeRHtoEa(BadLake7376)

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