split_vec_to_list_by_N: Split a Vector into a List by Every N-th Element

View source: R/CodeAndRoll2.R

split_vec_to_list_by_NR Documentation

Split a Vector into a List by Every N-th Element

Description

This function divides a given vector into chunks of size by (default is 9). The resulting list contains vectors of the specified chunk size or smaller.

Usage

split_vec_to_list_by_N(vec = 1:27, by = 9)

Arguments

vec

A numeric or character vector to be split.

by

Integer value specifying the chunk size. Default is 9.

Value

A list where each element is a vector containing up to by elements from vec.


vertesy/CodeAndRoll2 documentation built on Nov. 20, 2024, 5:23 a.m.