Learn R Programming

TSDT (version 1.0.7)

partition: partition

Description

Partitions a vector x into n groups of roughly equal size.

Usage

partition(x, n)

Value

A list of partitions of the vector x.

Arguments

x

Vector to partition.

n

Number of (roughly) equally-sized groups

Examples

Run this code
x <- 1:10
partition( x, 3 )

Run the code above in your browser using DataLab