splitter_a {plyr}R Documentation

Split an array by .margins

Description

Split a 2d or higher data structure into lower-d pieces based

Usage

splitter_a(data, .margins = 1)

Arguments

data
.margins

Details

This is the workhorse of the a*ply functions. Given a >1 d data structure (matrix, array, data.frame), it splits it into pieces based on the subscripts that you supply. Each piece is a lower dimensional slice.

The margins are specified in the same way as apply, but splitter_a just splits up the data, while apply also applies a function and combines the pieces back together. This function also includes enough information to recreate the split from attributes on the list of pieces.

Value

a list of lower-d slices, with attributes that record split details

Author(s)

Hadley Wickham <h.wickham@gmail.com>

Examples

splitter_a(mtcars, 1)
splitter_a(mtcars, 2)

[Package plyr version 0.1.5 Index]