makePermutedDesign: creates a 'data.frame' with some columns permuted

Description Usage Arguments Value Examples

View source: R/mi.R

Description

takes an input data.frame, permutes some variables, and stacks the resulting data.frames.

Usage

1
makePermutedDesign(data, vars, nperm)

Arguments

data

a data.frame a subset of which must be vars.

vars

a character vector indicating columns in data to permute.

nperm

an integer specifying the number of times to permute the columns indicated by vars.

Value

a data.frame with number of rows equal to nrow(data) * nperm

Examples

1
2
data = data.frame(x = 1:3, y = letters[1:3])
makePermutedDesign(data, "x", 3)

Example output

    x y
1   1 a
2   2 b
3   3 c
1.1 2 a
2.1 3 b
3.1 1 c
1.2 1 a
2.2 3 b
3.2 2 c

mmpf documentation built on May 1, 2019, 8:34 p.m.