select_door: Select Door Function.

Description Usage Arguments Details Value Examples

View source: R/montyhall.R

Description

select_door() is the function which simulates the user selecting a random door.

Usage

1

Arguments

No

arguments are used by the function.

Details

The initial door selection simulates the player choosing one of three closed doors. There are goats behind two of the doors and a car behind one of the doors. At this point in the game all three doors are still closed so the player doesn't know if they picked the car door or a goat door.

Value

The function returns a length one character vector which is a number between 1 and 3 and represents the number of the initial door selected. The returned value is assigned to the variable a.pick.

Examples

1

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