knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

gunit

CRAN status R-CMD-check

In plant physiology, conductance to heat, carbon dioxide, and water vapour are expressed in different units for different purposes. For heat exchange, units of m/s are most often used, whereas for gas exchange units of either mol/m^2/s (the default output from LICOR devices) or umol/m^2/s/Pa are used. I found it difficult to keep all the conversions straight, so I made a small package to help ensure proper conversion.

Installation

You can install the current version of gunit from GitHub with:

remotes::install_github("cdmuir/gunit")

Or the released version of gunit from CRAN with:

install.packages("gunit")

Example

This is a basic example which shows you how to solve convert conductance units:

library(gunit)
library(units)

g_sw = set_units(0.4, mol/m^2/s)
convert_conductance(g_sw)

# Change Temperature and Pressure
g_sw = set_units(0.4, mol/m^2/s)
convert_conductance(g_sw, 
                    P = set_units(80, kPa), 
                    Temp = set_units(293, K))

# Calculations can also be vectorized

g_sw = set_units(seq(0.1, 0.4, 0.1), mol/m^2/s)
convert_conductance(g_sw)

Contributors

Comments and contributions

I welcome comments, criticisms, and especially contributions! GitHub issues are the preferred way to report bugs, ask questions, or request new features. You can submit issues here:

https://github.com/cdmuir/gunit/issues

Meta



cdmuir/gunit documentation built on Oct. 23, 2022, 12:32 p.m.