Description Usage Arguments Details Value Examples
Randomize Assignment of Categories to Values in a Column
1 2 | randomizeCategories(x, cols = 1:ncol(x), magnitude = "MEDIUM",
probability = NULL)
|
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 |
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:
LOW: proability = .25
MEDIUM: probability = .5
HIGH: probability = .75
data.frame with some of the elements in specified columns randomized
1 2 3 | randomizeCategories(data)
randomizeCategories(data, magnitude="LOW")
randomizeCategories(data, 1:5, probability = .7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.