Learn R Programming

SciencesPo (version 0.11.21)

slice: Slice a vector

Description

Break up a vector by certain N sized chunks

Usage

slice(input, by = 2, pattern = NULL)

Arguments

input
Input character vector
by
Number by which to split the input character vector.
pattern
A value.

Examples

Run this code
x <- seq(1:15)
slice(x, by = 2, pattern = 3)

Run the code above in your browser using DataLab