mungeplane: Mungeplane are reference classes wrappers around a dataframe.

Description Usage Arguments Value Examples

Description

By exploiting pass-by-reference semantics of reference classes, mungeplanes allow mungebits to manipulate individual columns and rows of dataframes without forcing copy-on-write triggers that would copy the entire dataframe.

Usage

1
mungeplane(dataframe)

Arguments

dataframe

a data.frame. This can also be a list to help with optimization procedures in mungebit operations that temporarily remove the data.frame class to use built-in C replacement functions.

Value

mungeplane an environment with a "data" object of class "mungeplane"

Examples

1
2
3
4
5
6
## Not run: 
mp <- mungeplane(iris)
(function(plane) plane$data[[1]] <- 2 * plane$data[[1]])(mp)
stopifnot(all.equal(mp$data[[1]], 2 * iris[[1]]))

## End(Not run)

robertzk/mungebits documentation built on May 27, 2019, 10:35 a.m.