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))

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.

Value

A vector length n with cPRA percentages

Examples

cpra(n = 100, probs = c(0.7, 0.1, 0.1, 0.1))
#>   [1]  0 88  0 29  0  0  0  0  0  0  0  0 69  0  0  0  0 90  0 93  0  0  0  0 79
#>  [26]  0 92  0  0  0 35 33  0  0  0  0  0 66 32 72 66  0 68  0  0  0  0  0  0  0
#>  [51] 72  0 63  0  0  0  0 97  0  0  0 38  0 68 35 24 26 66  0  0  0  0  0  0 95
#>  [76] 93  0  0  0  0 94 33  0 89  0 35  0  0  0  0  0  0  0  0  0 88  0  0  0  0