| baseFunction | R Documentation |
Internal recursive function that creates nested list structures by sequentially grouping data by factors and applying a function to each subset. This is the core engine behind nestedFunBuilder and related functions.
baseFunction(currentData, remainingFactors, fun = identity, funArgs = list())
currentData |
data frame containing the current subset of data to process. |
remainingFactors |
character vector of factor names still to be processed. |
fun |
function to apply to each final data subset. Default is |
funArgs |
list of additional arguments to pass to |
This function works recursively:
Base case: If no factors remain, applies fun to the current data
Recursive case: Groups data by the first remaining factor, then calls itself on each subset with the remaining factors
A nested list structure where each level corresponds to a factor,
or the result of applying fun to the data subset if no factors remain.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.