xmasgalton: Christmas Galton card.

View source: R/xmasgalton.R

xmasgaltonR Documentation

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
)

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).

Value

A Christmas tree in a Galton board.

Author(s)

Jose Barrera-Gomez.

Examples


# 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)


christmas documentation built on Dec. 28, 2022, 1:09 a.m.