R/str2vec.R

Defines functions str2vec

Documented in str2vec

#' array-ify a string with a possible leading path/URL/whatever
#'
#' @param x   a string
#' @param y   a split character (default is " ")
#' 
#' @return    the array produced by splitting basename(x) on y
#'
#' @export
#'
str2vec <- function(x, y=" ") {
  strsplit(basename(x), y)[[1]]
}
ttriche/Rscripts documentation built on Sept. 14, 2023, 2:52 a.m.