play_game: Wrapping all the previous 5 game steps into single...

Description Usage Arguments Details Value Examples

View source: R/Montyhall.R

Description

The play_game()wraps up all the previously stated game steps into one function and returns the data frame that contains the results from one game.

Usage

1

Arguments

The

stay argument is a logical vector, as it includes values of either "True" or "False"

Details

The play_game() includes all the codes used in the previous 5 steps with the aim of returning the data frame that includes all the results related to one game, which means means no repetition. Therefore, we need to use the loop() to check which is the more dominant strategy, the stay or the switch strategy.The returned result after running the function is a length of one character vector indicating whether the contestant has won or not

Value

The returned result from the function is a length of one character vector indicating whether the contestant has won or not

Examples

1

Ma112120/Montyhall documentation built on Dec. 17, 2021, 2:14 a.m.