R/normalize_ghg_names.R

Defines functions normalize_ghg_names

Documented in normalize_ghg_names

#' Normalize GHG names based on ghg_dictionary
#'
#' @importFrom tibble tibble
#' @import dplyr
#' @export
normalize_ghg_names <- function(x) {

  input <- tibble(
    wildcaught_name = x
  )

  output <- left_join(input, ghg_dictionary, by = "wildcaught_name")

  stopifnot(nrow(input) == nrow(output))

  res <- pull(output, "normalized_common_name")

  res
}
jameelalsalam/ghgcalcs documentation built on Nov. 4, 2019, 2:16 p.m.