dice_2 | R Documentation |
dice_2
is a variant of dice
that
generates a sequence of events that
represent the results of throwing a dice
(with a given number of sides
) n
times.
dice_2(n = 1, sides = 6)
n |
Number of dice throws.
Default: |
sides |
Number of sides.
Default: |
Something is wrong with this dice. Can you examine it and measure its problems in a quantitative fashion?
Other sampling functions:
coin()
,
dice()
,
sample_char()
,
sample_date()
,
sample_time()
# Basics:
dice_2()
table(dice_2(100))
# 10-sided dice:
dice_2(sides = 10)
table(dice_2(100, sides = 10))
# Note:
dice_2(10, 1)
table(dice_2(5000, sides = 5))
# Note an oddity:
dice_2(n = 10, sides = 8:9) # works, but
dice_2(n = 10, sides = 9:9) # odd: see sample() for an explanation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.