Description Usage Arguments Details Value Examples
View source: R/Monty Hall Script.R
If the player wishes to stay with their initial door, then their initial pick is made their final pick. If the player wishes to switch to the remaining unopen door, then their final pick is made the unopened door.
1 | change_door(stay = T, opened.door, a.pick)
|
stay |
This argument's default vaule is TRUE but can be made FALSE. |
opened.door |
This argument is the numeric vector of length one equal to the opened door. |
a.pick |
This is a numeric vector of length one equal to the player's initial door. |
This function determines whether or not the player wishes to stay through a logical argument. If true, then the final pick is returned as the initial pick. If false, then the position of the door that was neither the player's first choice or opened door is determined. This value is then made the player's final pick.
This function returns the final pick of the player based on whether they chose to stay or switch.
1 2 3 | change_door(stay = T, opened.door = 3, a.pick = 1)
change_door(stay = F, opened.door = 3, a.pick = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.