computeFunctionByFactors: Compute results using an arbitrary function on columns in a...

Description Usage Arguments Value

View source: R/computeFunctionByFactors.R

Description

Function to compute results from an arbitrary function (fcn) on colunms in a dataframe, by a set of factor levels

Usage

1
2
computeFunctionByFactors(df, fcn = "sum", factors = NULL,
  vars = NULL, sortBy = NULL, ascending = TRUE, debug = FALSE)

Arguments

df

- dataframe (or object that can be cast to a dataframe) with variables and factors

fcn

- function name AS CHARACTER STRING to apply to each var in vars by each unique factor level combination

factors

- vector of names of columns in df to serve as factors in the function applications

vars

- vector of names of column in df that the function should be applied to

sortBy

- vector of factor column names to sort results by

ascending

- flag (T/F) to sort in ascending/descending order

debug

- flag (T/F) to print debugging info

Value

dataframe of results with columns corresponding to factors and vars


wStockhausen/wtsUtilities documentation built on Oct. 23, 2018, 10:27 p.m.