randomizeCategories: Randomize Assignment of Categories to Values in a Column

Description Usage Arguments Details Value Examples

Description

Randomize Assignment of Categories to Values in a Column

Usage

1
2
randomizeCategories(x, cols = 1:ncol(x), magnitude = "MEDIUM",
  probability = NULL)

Arguments

x

a data.frame

cols

the columns that are to be affected. If no value is given, all columns are affected.

magnitude

a shortcut for the probability parameter - see details

probability

- the probability that an element will be randomized

Details

By default, each observation has a 50 the value of another observation in the data. The replaced value is determined randomly following the distribution of the data, so the distribution of categories after randomization should be similar to the distribution of categories before randomization. The chance of replacement can be altered with the probability parameter. magnitude is a shortcut for the probability parameter:

Value

data.frame with some of the elements in specified columns randomized

Examples

1
2
3
randomizeCategories(data)
randomizeCategories(data, magnitude="LOW")
randomizeCategories(data, 1:5, probability = .7)

shuklak13/anonymizeR documentation built on May 29, 2019, 9:27 p.m.