simFlips | R Documentation |
Simulate a sequence of coin flips.
simFlips(n, prob=.5, seed=NULL,
show_title=TRUE, show_flips=TRUE,
grid="grey90", pause=FALSE,
main=NULL, pdf_file=NULL, width=5, height=5, ...)
n |
Size of each sample, that is, the number of trials or flips. |
prob |
Probability of a success on any one trial. |
seed |
Default seed is the R default. Enter a positive integer value to obtain a reproducible result, the same result for the same seed. |
show_title |
Place a title on the graph that contains the parameter values_ |
show_flips |
Plot the outcome of each flip. |
grid |
Color of the grid lines. |
pause |
Build the graph and the text output, pausing after each 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. |
Generate and plot successive values of a Head or a Tail using standard R rbinom
function.
David W. Gerbing (Portland State University; gerbing@pdx.edu)
# 10 flips of a fair coin
simFlips(10, .5)
# set the seed for a reproducible result with the same seed
simFlips(10, .5, seed=43)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.