#' Split a string vector with multiple split
#'
#' @param strVec One vector whose elements are to be split.
#' @param split character vector containing regular expression(s) to use for splitting.
#' @param simplify If TRUE, returns character vector; if not, list; Default is TRUE.
#'
#' @return vector or list of split characters.
#' @export
#'
#' @examples
strsplit0 <- function(strVec, split, simplify = TRUE) {
if (simplify == TRUE) {
for (sp in split) {
strVec <- strVecSplit(strVec, sp)
}
return(strVec)
} else {
strsplit0 <- list()
for (str in strVec) {
for (sp in split) {
str <- strVecSplit(str, sp)
}
strsplit0[[length(strsplit0) + 1]] <- str
}
return(strsplit0)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.