R/o2sat.R

Defines functions o2sat

Documented in o2sat

#' Oxygen Saturation in Fresh Water
#' 
#' Simple formula for oxygen saturation (in mg/L) from temperature (in deg C).
#' 
#' This is a simple function that can also be used to test availability of the 
#' SALMO shared library
#' 
#' @param T vector of temperatures (in deg C)
#' @seealso \code{\link[marelac]{gas_O2sat}} in package marelac
#' @examples
#' 
#' o2sat(c(10, 20))
#' 
#' @export o2sat

o2sat <-
function(T) {
  sat1 <- function(T) {
    res <- numeric(length(T))
    ret <- .C("osat", T = as.double(T), result = as.double(res))
    ret$result
  }
  sapply(T, sat1)
}

Try the rSALMO package in your browser

Any scripts or data that you put into this service are public.

rSALMO documentation built on May 31, 2017, 4:40 a.m.