Skip to contents

Returns a vector with ABO blood groups according to user defined frequencies

Usage

abo(n = 100, probs = c(0.4658, 0.0343, 0.077, 0.4229), seed.number = 123)

Arguments

n

An integer to define the length of the returned vector

probs

A vector with the probabilities for blood group A, AB, B and O (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 ABO blood groups

Examples

abo(n = 100, probs = c(0.4658, 0.0343, 0.077, 0.4229), seed.number = 123)
#>   [1] "A"  "O"  "A"  "O"  "B"  "A"  "O"  "B"  "O"  "A"  "B"  "A"  "O"  "O"  "A" 
#>  [16] "B"  "A"  "A"  "A"  "B"  "B"  "O"  "O"  "AB" "O"  "O"  "O"  "O"  "A"  "A" 
#>  [31] "B"  "B"  "O"  "O"  "A"  "O"  "O"  "A"  "A"  "A"  "A"  "A"  "A"  "A"  "A" 
#>  [46] "A"  "A"  "O"  "A"  "O"  "A"  "A"  "O"  "A"  "O"  "A"  "A"  "O"  "B"  "A" 
#>  [61] "O"  "A"  "A"  "A"  "O"  "A"  "O"  "O"  "O"  "A"  "O"  "O"  "O"  "A"  "O" 
#>  [76] "A"  "A"  "O"  "A"  "A"  "A"  "O"  "A"  "O"  "A"  "A"  "AB" "B"  "O"  "A" 
#>  [91] "A"  "O"  "A"  "O"  "A"  "A"  "O"  "A"  "O"  "O"