R/dep-extract.R

Defines functions extract_numeric

Documented in extract_numeric

# nocov start

#' Extract numeric component of variable.
#'
#' DEPRECATED: please use `readr::parse_number()` instead.
#'
#' @param x A character vector (or a factor).
#' @keywords internal
#' @export
extract_numeric <- function(x) {
  message("extract_numeric() is deprecated: please use readr::parse_number() instead")
  as.numeric(gsub("[^0-9.-]+", "", as.character(x)))
}

# nocov end

Try the tidyr package in your browser

Any scripts or data that you put into this service are public.

tidyr documentation built on Feb. 16, 2023, 7:40 p.m.