MyNixOS website logo
Description

Converts Conductance Units.

For plant physiologists, converts conductance (e.g. stomatal conductance) to different units: m/s, mol/m^2/s, and umol/m^2/s/Pa.

gunit

CRANstatus 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)
#> # A tibble: 1 × 3
#>     `m/s` `umol/m^2/s/Pa` `mol/m^2/s`
#>     [m/s] [umol/m^2/Pa/s] [mol/m^2/s]
#> 1 0.00979            3.95         0.4

# 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))
#> # A tibble: 1 × 3
#>    `m/s` `umol/m^2/s/Pa` `mol/m^2/s`
#>    [m/s] [umol/m^2/Pa/s] [mol/m^2/s]
#> 1 0.0122               5         0.4

# Calculations can also be vectorized

g_sw = set_units(seq(0.1, 0.4, 0.1), mol/m^2/s)
convert_conductance(g_sw)
#> # A tibble: 4 × 3
#>     `m/s` `umol/m^2/s/Pa` `mol/m^2/s`
#>     [m/s] [umol/m^2/Pa/s] [mol/m^2/s]
#> 1 0.00245           0.987         0.1
#> 2 0.00489           1.97          0.2
#> 3 0.00734           2.96          0.3
#> 4 0.00979           3.95          0.4

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

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for gunit in R doing citation(package = 'gunit')
  • Please note that the ‘gunit’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Metadata

Version

1.0.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows