sandpile: Sandpile

Description Usage Arguments Value See Also Examples

View source: R/sandpile.R

Description

Drop some sand in the center and see it spread outwards.

Usage

1
sandpile(n, colors = grey.colors(4, start = 1, end = 0))

Arguments

n

The number of grains dropped in the center.

colors

A vector of length 4 or NULL. Specifies the colors to be allocated to the values 0:4. If NULL, the number of grains per cell are returned instead. Defaults to a grey palette.

Value

A matrix of class "color_matrix", either containing colors or the number of grains per cell, depending on the value of colors.

See Also

plot.color_matrix()

Examples

1
2
s <- sandpile(1000)
plot(s)

BastiHz/fractalplotr documentation built on Sept. 9, 2021, 4:46 a.m.