[go: up one dir, main page]

File: multisplit.R

package info (click to toggle)
r-bioc-iranges 2.24.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,804 kB
  • sloc: ansic: 4,980; makefile: 2; sh: 1
file content (14 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
### =========================================================================
### 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))
}