R/plu_split.R

Defines functions plu_split

plu_split <- function(x, pattern, ...) {
  x      <- strsplit(x, pattern, ...)
  max_ln <- max(lengths(x))
  split  <- vapply(
    x, function(x) {c(x, character(max_ln - length(x)))}, character(max_ln)
  )
  matrix(split, ncol = length(x))
}

Try the plu package in your browser

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

plu documentation built on Sept. 24, 2023, 1:08 a.m.