partition.names.random: Split a set of names into random subsets

Description Usage Arguments Value Examples

Description

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.

Usage

1

Arguments

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.

Value

An S3 object of class "names.split". The individual groups can be retrieved using the operator [].

Examples

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)

aggloeckner/GerNameR documentation built on May 20, 2019, 8:01 p.m.