Learn R Programming

TSDT (version 1.0.0)

partition: partition

Description

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

Usage

partition(x, n)

Arguments

x

Vector to partition.

n

Number of (roughly) equally-sized groups

Value

A list of partitions of the vector x.

Examples

Run this code
# NOT RUN {
x <- 1:10
partition( x, 3 )
# }

Run the code above in your browser using DataLab