R/strings.R

#' Grab all the numbers from a list as a string
#' @param x A string
#' @return Numeric vector
#' @export
extract_numeric <- function(x) {
  as.numeric(unlist(regmatches(x, gregexpr("[[:digit:]]+", x))))
}
fennerm/fen.R.util documentation built on May 9, 2019, 10 p.m.