Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
'open_goat_door()' generates a number between 1 and 3 representing a door with a goat behind it and not the door that was selected by the contestant.
1 | open_goat_door(game, a.pick)
|
''game' |
and 'a.pick' are passed into the function. 'game' holds the info on which door hold either a goat or car. 'a.pick' is the chosen door by the contestant. |
This function uses 'if' statements to first determine if the contestant selected the car. If he did select the car, then a random goat door is opened. If the contestant chose a goat door, then the other goat door is opened.
The function returns numerical value representing an open door with a goat behind it.
1 2 | open_goat_door( new.game, first.pick )
open_goat_door( c("goat", "car", "goat"), 2 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.