Skip to contents

Returns a vector with cPRA percentages according to user defined frequencies

Usage

cpra(n = 100, probs = c(0.7, 0.1, 0.1, 0.1), seed.number = 123)

Arguments

n

An integer to define the length of the returned vector

probs

A vector with the probabilities for cPRA groups 0%, 1%-50%, 51%-84%, 85%-100% (in this order). The sum of the probabilities must be equal to one.

seed.number

Seed for pseudo random number generator.

Value

A vector length n with cPRA percentages

Examples

cpra(n = 100, probs = c(0.7, 0.1, 0.1, 0.1), seed.number = 123)
#>   [1]   0  73   0  37  82   0  21   0   0   0  88   0  37   0   0   0   0  98
#>  [19]  71  79   0   0   0  34 100   0   0   0  29   0  66   0  60   0   0   0
#>  [37]   0   0   0   0   0   0  31   0  57   0   0   0  29   0   0  95   0   0
#>  [55]  64   0   0   0   0   0  95   0   0   0   0  90   0  39  69   0  94  27
#>  [73]   0   0   0   0   0  93   0   0   0  94  30   0   0   0   0   0  95   0
#>  [91]   0   0   0   0   0   0   0   0  82   0