R/f2.R

Defines functions f2

Documented in f2

#' @title Calculate the \code{f2} parameter
#' @description Calculates the \code{f2} model parameter, which is specific to tillage type.
#' @param till_type A character vector indicating tillage type. One of "unknown", "full", "reduced",
#' or "zero".
#' @param params A named list containing model parameters. Defaults to the package default parameter
#' set \code{soilc_params}.
#' @import dplyr
f2 <- function(till_type, params = soilc_params) {
  case_when(
    till_type == "unknown" ~ params$f2$be,
    till_type == "full" ~ params$f2_ft$be,
    till_type == "reduced" ~ params$f2_rt$be,
    till_type == "zero" ~ params$f2_nt$be,
    TRUE ~ params$f2$be
  )
}
aj-sykes92/soilc.ipcc documentation built on March 19, 2021, 11:52 a.m.