ezpermutations: Resample sample labels for permutation testing

Description Usage Arguments Details Value

View source: R/ezpermutations.R

Description

Resample unique sample or group labels (unique elements of xx) into nperm data frame columns of length length(xx) for permutation testing. The columns are not duplicates of each other, do not contain xx, and have each element of unique(xx) to appear at least once. Calculations are done with RcppAlgos.

Usage

1
ezpermutations(xx, nperm, freq = length(xx) - length(unique(xx)) + 1)

Arguments

xx

Vector of labels or indices to resample. Must be of length at least 2.

nperm

Number of resamples to return.

freq

Integer number of times to repeat each element of names(table(xx)) within each resample. Can be a vector where length(freq)==length(table(xx)) or of length 1, which is recycled into a vector. Represents resampling without replacement if it's table(xx). For resampling with replacement (bootstrapping), length(xx)-length(table(xx))+1 allows each element of unique(xx) to appear at least once in each resample.

Details

Number of returned resamples may be less than nperm if not enough unique resamples are available.

Value

Data frame whose columns are same type as xx


jdreyf/PANTS documentation built on July 18, 2019, 10:12 a.m.