mvl_group_lapply: Apply function to index stretches

View source: R/RMVL.R

mvl_group_lapplyR 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 mvl_group

fn

a function of one argument - list of indices

Value

a list of results of function fn

See Also

mvl_group

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)

RMVL documentation built on Nov. 2, 2023, 6:09 p.m.

Related to mvl_group_lapply in RMVL...