Difference between revisions of "OpasnetUtils/Tapply"
From Testiwiki
m |
m |
||
Line 16: | Line 16: | ||
label="Initiate functions" | label="Initiate functions" | ||
graphics="1" | graphics="1" | ||
+ | showcode="1" | ||
> | > | ||
# TAPPLY ########### tapply of ovariables applies a function to each cell of a ragged array, that is to each (non-empty) group of | # TAPPLY ########### tapply of ovariables applies a function to each cell of a ragged array, that is to each (non-empty) group of |
Revision as of 10:52, 15 June 2012
This page is a method.
The page identifier is Op_en5741 |
---|
Moderator:Nobody (see all) Click here to sign up. |
This page is a stub. You may improve it into a full page, and then a rating bar will appear here. |
Upload data
|
Contents
Description
tapply of ovariables applies a function to each cell of a ragged array, that is to each (non-empty) group of values given by a unique combination of the levels of certain factors.
Parameters
- X an ovariable
- (other parameters are as in generic tapply)
Code
# TAPPLY ########### tapply of ovariables applies a function to each cell of a ragged array, that is to each (non-empty) group of ############ values given by a unique combination of the levels of certain factors. ### parameters (other parameters are as in generic tapply): ### X an ovariable temp <- setMethod(f = "tapply", signature = signature(X = "ovariable"), definition = function(X, INDEX, FUN = NULL, ..., simplify = TRUE) { out <- as.data.frame(as.table(tapply(X@output$Result, INDEX, FUN, ..., simplify = TRUE))) colnames(out)[colnames(out) == "Freq"] <- "Result" X@output <- out return(X) } ) |