Description Usage Arguments Value Examples
Creates a random split of a subset or all naes. Names can be split into subsets of different size based on the proportion of the names in each subset after the split.
1 | partition.names.random(subset = filter.names(), prop = c(0.5, 0.5))
|
subset |
An optional subset on which the split should be done. If this is left out, the split will be created on all names. |
prop |
Proportion of the names in each subset (defaults to two groups of equal size). Proportions are given as a vector with the proportion in each group. Proportions are automatically normalized. |
An S3 object of class "names.split". The individual groups can be retrieved using the operator [].
1 2 3 4 5 6 7 8 9 | # Two random groups of equal sizes from all names
s <- partition.names.random()
# Three groups of different proportions (first group twice as large)
s <- partition.names.random( prop = c(2,1,1) )
# First filter on Competence, then split randomly
n <- filter.names(Competence >= 0.5)
s <- partition.names.random(subset=n)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.