Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
This function will allow the contestant to change their first pick if they wanted to.
1 | change_door(stay = T, opened.door, a.pick)
|
The |
function "if" will help to run different commands depending on the contestant choice. If the contestant selects to "stay" then his previous pick will be remain the same (and will be a final pick). If the contestant chooses to change the door then the function "if" will run the code to choose a different door from the remaining ones, and this will be his final pick. |
This function will be using the variables "stay", "opened door", and the "a.pick", this variable was previously used in the previous function. The contestant will decide if they want to stay or get another pick.
The function will be returning the final pick of the contestant, (either if it is still their first choice o a new choice).
1 | change_door( )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.