subdivide: Divide a vector or list

View source: R/skUtils.R

subdivideR Documentation

Divide a vector or list

Description

Divide a vector or list into parts of (preferably) equal length. Either the length or the number of the parts can be set.

Usage

subdivide(x, divs, divlen)

Arguments

x

the to-be-divided object.

divs, divlen

The number of divisions and the preferred length of divisions. One and only one of divs and divlen must be given.

Value

A list consisting of x, divided in parts.

Author(s)

Sercan Kahveci

Examples

subdivide(letters, divs=5)
subdivide(1:10, divlen=3)


Spiritspeak/skMisc documentation built on April 12, 2025, 5:40 a.m.