mvl_group_lapply {RMVL} | R Documentation |
Apply function to index stretches
Description
Iteratively call function fn(idx)
over index stretches previously computed with mvl_group
Usage
mvl_group_lapply(G, fn)
Arguments
G |
a list of groups and group stretches produced by |
fn |
a function of one argument - list of indices |
Value
a list of results of function fn
See Also
Examples
## Not run:
Mtmp<-mvl_open("tmp_a.mvl", append=TRUE, create=TRUE)
mvl_write_object(Mtmp, data.frame(x=rep(c("a", "b"), 50), y=(1:100)/5), "df1")
Mtmp<-mvl_remap(Mtmp)
df1<-Mtmp$df1
G<-mvl_group(list(df1[,"x",ref=TRUE], df1[,"y", ref=TRUE]))
mvl_group_lapply(G, function(idx) { return(sum(df1[idx, "y"]))})
## End(Not run)
[Package RMVL version 1.1.0.0 Index]