SplitAt: Split a Vector Into Several Pieces at Given Positions

View source: R/DescTools.r

SplitAtR Documentation

Split a Vector Into Several Pieces at Given Positions

Description

Split a vector into several pieces at given positions.

Usage

SplitAt(x, pos)

Arguments

x

the vector to be splitted.

pos

integer vector, giving the positions at which the vector should be splitted.

Value

a list with the splitted parts of x.

Author(s)

flodel (on StackOverflow)

References

https://stackoverflow.com/questions/16357962/r-split-numeric-vector-at-position

See Also

split, strsplit

Examples

x <- 1:10
SplitAt(x, pos=c(3, 8))

AndriSignorell/DescTools documentation built on April 13, 2024, 6:33 a.m.