applyover: Apply a function over a dataframe after splitting along some...

Description Usage Arguments Value

View source: R/applyover.R

Description

Apply a function over a dataframe after splitting along some "over" variable

Usage

1
2
3
4
5
6
7
8
applyover(
  applyfun = NULL,
  applyargs = NULL,
  fallbackargs = NULL,
  settosplit = NULL,
  nameaftersplit = NULL,
  over = NULL
)

Arguments

applyfun

The character name of a function to apply.

applyargs

A named list of arguments supplied to applyfun.

fallbackargs

A named list of arguments to replace arguments in applyargs if the call to applyfun results in an error. Any arguments in applyargs that are not named in fallbackargs will be reused.

settosplit

A dataframe that will be split by the 'over' parameter below.

nameaftersplit

The name of the argument of applyfun that takes the settosplit dataframe after it has been split; this is commonly 'x' or 'data'

over

The name of the factor variable in settosplit, over which it should be split.

Value

This function returns a named list of results, having applied applyfun to settosplit for every level of the 'over' variable. So for example, applyover(...)[["a"]] is the result of applyfun(data[data$over == 'a']).


EcoGRAPH/clusterapply documentation built on March 8, 2021, 1:55 p.m.