Apply a function on track expression in intervals

glply(f, expr, intervals = NULL, iterator = NULL, colnames = NULL,
  nchunks = 1, parallel = FALSE, verbose = FALSE,
  gfunc = misha::gextract)

gdply(...)

Arguments

f
function to apply. First argument would be the result of gfunc called with the track expression, intervals, iterator and column names, i.e.: we would run for each chunk f(gfunc(expr, intervals, iterator=iterator, colnames=colnames)) For additional parameters use anonymous functions, e.g. function(x) f1(x, param1=1, param2=2)
expr
track expression for gfunc
intervals
intervals for which track expressions are calculated
iterator
track expression iterator. If 'NULL' iterator is determined implicitly based on track expressions
colnames
sets the columns names in the returned value. If 'NULL' names are set to track expression.
nchunks
number of chunks to divide the intervals to.
parallel
run each chunk in parallel
verbose
verbose
gfunc
function to apply on track expression. can be any function that gets track expression, intervals, iterator and colnames, e.g. gextract, gextract.left_join, gscreen etc.

Value

for llply - list with the returned values from the functions. for ldply - data.frame with the returned values from the functions rbinded.