R/as_numeric.R

Defines functions as_numeric

Documented in as_numeric

#' As numeric
#' @param x character vector with numeric values where comma is used as thousand seperator
#'
as_numeric <- function(x) {

  gsub(",", ".", x) %>%
    as.numeric() %>%
    {. * 1000}

}
kristian-bak/kb.yahoo documentation built on July 18, 2022, 5:57 p.m.