split_vector_at: Split a vector at positions

View source: R/split_vector_at.R

split_vector_atR Documentation

Split a vector at positions

Description

This function splits a vector at specific positions.

Usage

split_vector_at(x, at)

Arguments

x

[atomic()']
A vector of elements.

at

[integer()]
Index position(s) just before to split.

For example, at = n splits before the nth element of x.

Value

A list.

References

Based on https://stackoverflow.com/a/19274414.

See Also

Other vector helpers: check_numeric_vector(), check_probability_vector(), chunk_vector(), insert_vector_entry(), match_numerics(), permutations(), subsets(), vector_occurrence()

Examples

x <- 1:10
split_vector_at(x, c(2, 3, 5, 7))

oeli documentation built on Oct. 16, 2024, 5:08 p.m.