Extract Strata from a Data Frame

DESCRIPTION:

The right hand side of form, or of each element of form, when given as a list, is evaluated in data and must result in a factor, or an integer vector. In the latter case, the unique elements of the stratification variable, when sorted, must form a sequence of consecutive integers.

USAGE:

getStrata(object, form) 

REQUIRED ARGUMENTS:

object
an object inheriting from class data.frame.
form
a one-sided formula specifying an stratification variable, or a list of one-sided formulas specifying stratification variables.

VALUE:

either an integer vector with values ranging from zero to the number of strata minus one, or, when form is given as a list, a list of such integer vectors.

SEE ALSO:

EXAMPLES:

getStrata(Orthodont, ~Sex) 
getStrata(Pixel, list(~Dog, ~Side))