Learn R Programming

BIOdry (version 0.3)

splitFrame: Splitting of multilevel data

Description

This function splits a Multilevel data frame into the specified level.

Usage

splitFrame(rd, lv = 1)

Arguments

rd
data.frame object with factor-level columns.
lv
Numeric or character. Position number in the factor-level columns of rd, or correspondant column name to split the data. If the spliting column is not a factor, the character name of the column should be used.

Value

of data.frame objects.

Examples

Run this code
##Ring data frame:
##Multilevel data frame of tree-ring widths:
data(Prings05,envir = environment())

## split the multilevel data into its second factor-level column:
spl <- splitFrame(Prings05,2)
str(spl)
## split the data into the factor-level: 'year':
spl <- splitFrame(Prings05,'year')
str(spl)

Run the code above in your browser using DataLab