permute: Generate permutation subsets

Description Usage Arguments Details Value Methods (by class)

Description

Generate R replicates with permutations of the rows or groups of a data frame.

Usage

1
2
3
4
5
6
7
permute(data, ...)

## S3 method for class 'data.frame'
permute(data, R = 1L, ...)

## S3 method for class 'grouped_df'
permute(data, R = 1L, stratify = FALSE, ...)

Arguments

data

A data frame

...

Arguments passed to methods

R

The number of permutations to generate.

stratify

If TRUE, the permute observations within each group. Otherwise permute the groups themselves.

Details

If R is greater than the total number of permutations, only the total number of permutations is returned. Since the total number of permutations is factorial(n), this will only happen if n is small.

Value

A data frame with R rows and the following columns:

train

A list of resample objects. Training sets.

test

A list of resample objects. Test sets.

.id

An integer vector of identifiers

Methods (by class)


jrnold/resamplr documentation built on May 20, 2019, 1:05 a.m.