change_door: Change Doors

Description Usage Arguments Details Value Examples

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

Description

The game continue with adding more code to allow the contestant the option of selecting another door that is still closed with a change door function.

Usage

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

Arguments

The

change_door function calls upon the arguments stay, opened.door and a.pick. The door function takes in the logical vectors 1-3. If statements evaluate the stay argument and assigns the output to function final.pick.

Details

The contestant is given the option to change from their initial selection to the other door that is still closed. The function will represent the game-playing strategy as the argument stay=TRUE or stay=FALSE.

Value

The return would be a logical vector, an integer, between 1 and 3.

Examples

1
2
3
  1
  2
  3

scribenaz/montyhall documentation built on Jan. 31, 2021, 12:48 a.m.