Learn R Programming

christmas (version 1.4.0)

xmasgalton: Christmas Galton card.

Description

Christmas Galton card (2018). A Christmas tree in the Galton board. This is an adaptation of quincunx() in package animation, which simulates the Galton board (https://en.wikipedia.org/wiki/Bean_machine).

Usage

xmasgalton(
  year = 2019,
  language = c("english", "spanish", "catalan"),
  balls = 240,
  layers = 15,
  onlyBoard = FALSE,
  treeballs = 15,
  time = 0.02,
  seed = NULL
)

Value

A Christmas tree in a Galton board.

Arguments

year

Year to be printed. Default is 2019.

language

Language to be used in the card. One of c("english", "spanish", "catalan"). Default is "english".

balls

The number of balls in the board. Default is 240.

layers

The number of layers in the board. Default is 15.

onlyBoard

Logical. If FALSE (default), an empirical Christmas normal tree estimated from data is added to the histogram.

treeballs

The number of balls to be added to the Christmas normal tree. Default is 15.

time

Elapsed time, in seconds, between two consecutive balls in the board. Default is 0.02.

seed

Seed for reproducibility of the card. Default is NULL (no seed).

Author

Jose Barrera-Gomez.

Examples

Run this code
# \donttest{
# more balls, less layers:
xmasgalton(balls = 300, layers = 9, time = 0.01)
# no balls in the gaussian christmas tree:
xmasgalton(balls = 400, layers = 11, time = 0.005, treeballs = 0)
# }

Run the code above in your browser using DataLab