change_door: Contestant stays or switches.

Description Usage Arguments Details Value Examples

View source: R/monty-hall-problem.R

Description

'change_door()' uses the argument "stay" for the contestant deciding to stay at the door they first picked or switch to the remaining door.

Usage

1
change_door(stay = T, opened.door, a.pick)

Arguments

stay

Logical argument to equal "T" or "F" to decide if the contestant stays at the a.pick door or switches.

Details

If the contestant decides to stay (stay=T), the numeric vector 'a.pick' does not change. If the contestant decides to switch (stay=F), the numeric vector that is not 'a.pick' or 'opened.door' is returned.

Value

The function returns a numeric vector (1-3) that cannot match 'opened.door'.

Examples

1
2
  change_door(stay=T, opened.door, a.pick)
  change_door(stay=F, opened.door, a.pick)

ekmcintyre/montyhall documentation built on Feb. 1, 2021, 12:24 a.m.