byXflex: Same as 'byX', but with more flexible group size, to avoid...

Description Usage Arguments Value Examples

Description

The 'subset_size' param is internally optimized using correctSetSize and then byX is called.

Usage

1
byXflex(data, indices, subset_size = 5, FUN, sort_indices = TRUE, ...)

Arguments

data

Data.frame whose subset to use on FUN

indices

Vector of group assignments, same length as nrow(data)

subset_size

Ideal number of groups to use in one subset – this can be changed internally, from 75%-150%

FUN

function Applied to subsets of data

sort_indices

Groups are formed by their sorted character(!) names

...

More arguments to FUN

Value

list of function result (one entry for each subset)

Examples

1
2
3
4
5
 stopifnot(
   byXflex(data.frame(d=1:10), 1:10, 2, sum, sort_indices = FALSE) ==
   c(3, 7, 11, 15, 19)
 )
 


Search within the PTXQC package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.