View source: R/20-api-generics.R
| split_at | R Documentation |
Splits by a single one-based position or a single element name.
split_at(x, at, pull_index = FALSE)
x |
A |
at |
A single positive integer position or a single character name. |
pull_index |
Controls output shape:
|
split_at(x, at, pull_index = FALSE) is a convenience wrapper around
split_around_by_predicate() using positional scanning.
split_at(x, at, pull_index = TRUE) is the two-way variant using
split_by_predicate().
A split result with shape controlled by pull_index.
x <- flexseq("a", "b", "c", "d")
split_at(x, 3)
split_at(x, 3, pull_index = TRUE)
n <- flexseq(a = 1, b = 2, c = 3)
split_at(n, "b")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.