Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R View source: R/monty-hall-problem.R
1 2 3 | change_door allows the contestant the opportunity to
switch the initially assigned door with the one
remaining door opened
|
1 | change_door(stay = T, opened.door, a.pick)
|
stay=T |
or stay=F: a character signifying TRUE or FALSE to the contestant's choice of keeping their current door (stay=T), or switching doors with the host (stay=F) open.door- an integer (1:3) returned from open_goat_door that signifies the goat door opened and removed from gameplay a.pick- an integer (1:3) returned as the contestant's initial pick |
1 2 3 4 5 6 7 8 9 | the function receives stay=T or stay=F
if stay=T the function stores the integer stored in
a.pick in final.pick
if stay=F the function stores the door that is NOT
the door determined by open_goat_door (goat.door)
or the door that determined by select_door (a.pick)
and stores the remaining integer (door) in final.pick
|
1 2 3 4 | stores one of the following in final.pick:
[1] 1
[1] 2
[1] 3
|
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.