R/soilwater4.R

Defines functions soilwater4

Documented in soilwater4

soilwater4 <- 
function(psi, Bd, a, b, c, model = c("Silva", "Ross"))
{
    model <- match.arg(model)
    if (model == "Silva") {
       if (length(psi) != length(Bd)) 
           stop("incompatible dimensions!")
       dat <- cbind(psi, Bd)
       if (!is.numeric(dat)) 
           stop("non-numeric data!")
       theta <- exp(a + b * Bd) * psi^c
    } else {
       stopifnot(inherits(psi, "numeric"))
       theta <- a * psi^c
    }
    return(theta)
}

Try the soilphysics package in your browser

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

soilphysics documentation built on June 7, 2022, 5:06 p.m.