Learn R Programming

plyr (version 1.5.2)

idata.frame: Construct an immutable data frame.

Description

Construct an immutable data frame.

Usage

idata.frame(df)

Arguments

df
a data frame

Value

  • an immutable data frame

Details

An immutable data frame works like an ordinary data frame, except that when you subset it, it returns a reference to the original data frame, not a a copy. This makes subsetting substantially faster and has a big impact when you are working with large datasets with many groups.

This method is still a little experimental, so please let me know if you run into any problems.

Examples

Run this code
system.time(dlply(baseball, "id", nrow))
system.time(dlply(idata.frame(baseball), "id", nrow))

Run the code above in your browser using DataLab