Learn R Programming

lessR (version 3.7.6)

simFlips: Pedagogical Binomial Simulation, Coin flips

Description

Simulate a sequence of coin flips.

Usage

simFlips(n, prob=.5, show.title=TRUE,
         show.flips=TRUE, grid="grey90", pause=FALSE,
         main=NULL, pdf.file=NULL, width=5, height=5, …)

Arguments

n

Size of each sample, that is, the number of trials or flips.

prob

Probability of a success on any one trial.

show.title

Place a title on the graph that contains the parameter values.

show.flips

Plot the outcome of each flips.

grid

Color of the grid lines.

pause

Build the graph and the text output confidence interval by confidence interval.

main

Title of graph.

pdf.file

Name of the pdf file to which graphics are redirected.

width

Width of the pdf file in inches.

height

Height of the pdf file in inches.

Other parameter values, possibly invalid.

Details

Generate and plot successive values of a Head or a Tail using standard R rbinom function.

Examples

Run this code
# NOT RUN {
# 10 flips of a fair coin
simFlips(10, .5)
# }

Run the code above in your browser using DataLab