MEapply: Apply functions to Data in Object of Class "ModelEnv"

Description Usage Arguments Examples

View source: R/Utilities.R

Description

Apply a single function or a collection of functions to the data objects stored in a model environment.

Usage

1
2
## S4 method for signature 'ModelEnv'
MEapply(object, FUN, clone = TRUE, ...)

Arguments

object

Object of class "ModelEnv".

FUN

Function or list of functions.

clone

If TRUE, return a clone of the original object, if FALSE, modify the object itself.

...

Passed on to FUN.

Examples

1
2
3
4
5
6
7
8
9
data("iris")
me <- ModelEnvFormula(Species+Petal.Width~.-1, data=iris,
                      subset=sample(1:150, 10))

me1 <- MEapply(me, FUN=list(designMatrix=scale,
                            response=function(x) sapply(x, as.numeric)))

me@get("designMatrix")
me1@get("designMatrix")

modeltools documentation built on March 13, 2020, 1:53 a.m.