Skip to contents

Calculates any matching birthdays in the data and the probability of having a matching birthday (i.e. birthday paradox)

Usage

birthday_paradox(x, ...)

# S3 method for birthdays
birthday_paradox(x, ...)

Arguments

x

A `birthdays` object

...

Arguments to be passed to methods

Value

A named numeric vector with two elements

Examples

df <- data.frame(
  name = c("kevin", "stacey"),
  birthday = c(as.Date("2001-01-01"), as.Date("2002-01-02"))
)
birthdays <- birthdays(df)
birthday_paradox(birthdays)
#>   num_coincidence prob_coincindence 
#>       0.000000000       0.002739726