R/unit_convs.R

Defines functions boof_kgha_to_buac_corn boof_buac_to_kgha_corn boof_lbac_to_kgha

Documented in boof_buac_to_kgha_corn boof_kgha_to_buac_corn boof_lbac_to_kgha

#' boof_lbac_to_kgha
#'
#' @param dat_lbac A vector of values in pounds per acre
#'
#' @return A vector of values in kilograms per hectare; multiplied by 1.123
#' @export
#'
boof_lbac_to_kgha <- function(dat_lbac) {
  dat_kgha <- dat_lbac *1.123
  return(dat_kgha)

}


#' boof_buac_to_kgha_corn
#'
#' @param dat_buac A vector of corn yields in bushels per acre
#'
#' @return A vector of corn yields in dry kilograms per hectare; adjusted for the 15% moisture the bu/ac are reported at
#' @export
#'
boof_buac_to_kgha_corn <- function(dat_buac) {
  dat_kgha <- dat_buac * (1-0.155) * 56 * (0.453592) * (2.47105)
  return(dat_kgha)

}


#' boof_kgha_to_buac_corn
#'
#' @param dat_kgha A vector of corn yields in DRY kgs per hectare
#'
#' @return A vector of corn yields in bushels per acre; adjusted for the 15.5% moisture the bu/ac are reported at
#' @export
#'
boof_kgha_to_buac_corn <- function(dat_kgha) {
  dat_buac <- dat_kgha * (0.404686) * (2.20462) * 1/(1-0.155) * (1/56)
  return(dat_buac)

}
vanichols/GinaBooty documentation built on Oct. 14, 2020, 3:26 a.m.