powered by
byX
The 'subset_size' param is internally optimized using correctSetSize and then byX is called.
correctSetSize
byXflex(data, indices, subset_size = 5, FUN, sort_indices = TRUE, ...)
list of function result (one entry for each subset)
Data.frame whose subset to use on FUN
Vector of group assignments, same length as nrow(data)
Ideal number of groups to use in one subset -- this can be changed internally, from 75%-150%
function Applied to subsets of data
Groups are formed by their sorted character(!) names
More arguments to FUN
stopifnot( byXflex(data.frame(d=1:10), 1:10, 2, sum, sort_indices = FALSE) == c(3, 7, 11, 15, 19) )
Run the code above in your browser using DataLab