open_goat_door: Open Goat Door Function.

Description Usage Arguments Details Value Examples

View source: R/montyhall.R

Description

open_goat_door is the function which simulates the game show host opening one of the doors that is known to have a goat behind it.

Usage

1
open_goat_door(game, a.pick)

Arguments

This

function contains two arguments. The host should never open the door picked by the contestant and should never open the car door. To ensure this, the argument uses the 'not equal' operator. The door the host opens is not equal to a.pick and not equal to "car".

Details

After the player makes their initial door selection, the host will oepn one of the goat doors. At this point in the game there are still two closed doors; the one picked by the contestant and door #3.

Value

This function returns a length one character vector which is a number between 1 and 3 and represents a known goat door. The returned value is assigned to variable opened.door.

Examples

1

RTrehern-ASU/montyhall documentation built on Sept. 22, 2020, 12:42 a.m.