R/randBatch.R

Defines functions randBatch

randBatch <- function(d) {
    
    lst <- lapply(split(seq_len(nrow(d)), d$date), function(x) {
        x[sample.int(length(x))]
    })
    
    d <- d[unlist(lst, use.names = FALSE), ]
    rownames(d) <- NULL
    return(d)
}
TRUE
TRUE
dsrobertson/onlineFDR documentation built on April 21, 2023, 8:17 p.m.