R/currency_to_numeric.R

Defines functions currency_to_numeric

Documented in currency_to_numeric

#' Currency to Numeric
#'
#' @description coerce dollar amounts to numeric values. Removes "$" and "," and coerces to numeric.
#'
#' @param x a vector of dollar amounts
#'
#' @return a numeric vector
#' @export
#'
currency_to_numeric  <- function(x) {

  stringr::str_remove_all(x, "\\$|,|£|€") %>%
    as.numeric()

}
crazybilly/fundRaising documentation built on July 30, 2021, 12:51 a.m.