R/str2vec.R

Defines functions str2vec

Documented in str2vec

#' String to numeric vector
#'
#' @param string A string containing numbers
#' @param sep The separator between numbers
#'
#' @export

str2vec <- function(string, sep = ' ') {

  as.numeric(unlist(strsplit(as.character(string), sep)))

}
rscherrer/EGS documentation built on April 19, 2020, 10:26 p.m.