Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
If statements are used to compare results of previous step to determine if the contestant has won or lost the game.
1 | determine_winner(final.pick, game)
|
The |
determine_winner function calls upon the final.pick and game arguments. The IF statements evaluate the game function based upon final.pick function. |
The final.pick is called from a previous step and put through if statements to return the game results. If the final pick was a goat, the result is LOSE. If the contestant picks a car, then the result is a WIN.
The return is an atomic vector
1 | WIN LOSE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.