tosscoin {probs}R Documentation

Tossing a Coin

Description

Sets up a sample space for the experiment of tossing a coin repeatedly with the outcomes "H" or "T".

Usage

tosscoin(times, makespace = FALSE)

Arguments

times

number of tosses.

makespace

logical. Include a column of equally likely probabilities if TRUE.

Details

The function uses expand.grid() to generate all possible sequences of flips resulting from the experiment of tossing a coin. Columns of the dataframe are denoted toss1, toss2, up to tosstimes.

Value

A data frame, with an equally likely probs column if makespace is TRUE.

Author(s)

G. Jay Kerns gkerns@ysu.edu.

See Also

rolldie

Examples

tosscoin(2)
tosscoin(3, makespace = TRUE)


[Package probs version 0.9.9 Index]