Skip to content

Commit f987989

Browse files
authored
Merge pull request #3598 from dlebauer/saturated_vapor_pressure
Quick update to #3597: export and document t2es alias; add venv/ to .Rbuildignore
2 parents 7823959 + 28f31a0 commit f987989

5 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
^.*\.Rproj$
22
^\.Rproj\.user$
33
^docs$
4+
.*venv/

modules/data.atmosphere/NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export(split_wind)
105105
export(subdaily_pred)
106106
export(sw2par)
107107
export(sw2ppfd)
108+
export(t2es)
108109
export(temporal.downscale.functions)
109110
export(temporal_downscale_half_hour)
110111
export(upscale_met)

modules/data.atmosphere/R/metutils.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ get.vpd <- function(rh, temp) {
103103
#' WMO (2014) Guide to Instruments and Methods of Observation (WMO-No. 8), ch. 4.
104104
#' @md
105105
#' @author David LeBauer
106+
#' @examples
107+
#' # Calculate saturation vapor pressure at 20°C
108+
#' sat_vapor_pressure(20)
109+
#' t2es(20)
110+
#'
111+
#' # Using different methods
112+
#' t2es(c(10, 20, 30), method = "Magnus")
113+
#' t2es(283.15, temp_units = "K", method = "GoffGratch")
114+
#'
115+
#' # Different output units
116+
#' t2es(20, out_units = "hPa")
106117
#' @export
107118
sat_vapor_pressure <- function(
108119
temp,
@@ -158,6 +169,12 @@ get.es <- function(temp) {
158169
)
159170
}
160171

172+
#' @rdname sat_vapor_pressure
173+
#' @export
174+
t2es <- function(temp, temp_units = "degC", out_units = "kPa", method = "ClausiusClapeyron") {
175+
sat_vapor_pressure(temp = temp, temp_units = temp_units, out_units = out_units, method = method)
176+
}
177+
161178
##' Calculate RH from temperature and dewpoint
162179
##'
163180
##' Based on equation 12 in Lawrence 2005, The Relationship between

modules/data.atmosphere/man/sat_vapor_pressure.Rd

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/data.land/.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
contrib
22
data-raw
33
^docs$
4+
.*venv/

0 commit comments

Comments
 (0)