R/multisplit.R

Defines functions multisplit

Documented in multisplit

### =========================================================================
### multisplit()
### -------------------------------------------------------------------------
###


multisplit <- function(x, f) {
  if (!is.list(f) && !is(f, "List"))
    stop("'f' must be a list")
  if (length(x) != length(f))
    stop("Length of 'f' must equal length of 'x'")
  splitAsList(rep(x, elementNROWS(f)), unlist(f, use.names = FALSE))
}

Try the IRanges package in your browser

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

IRanges documentation built on Dec. 14, 2020, 2 a.m.