Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

partition

Patitions an object into different sets


Description

Partitions an object into subsets of length defined in the sep argument.

Usage

partition.vector(x, sep, ...)
partition.matrix(x, rowsep, colsep, ...)

Arguments

x

object to be partitioned.

sep

determines how many elements should go into each set. The sum of sep should be equal to the length of x.

rowsep

determins how many rows should go into each set. The sum of rowsep must equal the number of rows in x.

colsep

determins how many columns should go into each set. The sum of colsep must equal the number of columns in x.

...

arguments used in other methods of partition.

Value

A list of equal length as sep containing the partitioned objects.

Author(s)

Charles Dupont

See Also

Examples

a <- 1:7
partition.vector(a, sep=c(1,3,2,1))

Hmisc

Harrell Miscellaneous

v4.5-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>, with contributions from Charles Dupont and many others.
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.