fuzzyround: Fuzzy (random) rounding.

Description Usage Arguments Examples

View source: R/numerics.R

Description

Values are rounded at random, with probabilities determined by how close they are to the integers either side. This may be useful for interesting colour dithering in images.

Usage

1

Arguments

x

a numeric vector or matrix.

Examples

1
2
x = seq(0,20,length.out=200); plot(x, fuzzyround(x))
image(fuzzyround(toeplitz(seq(5,1,length.out=200))), col=heat.colours())

stevetnz/stevesRfunctions documentation built on May 28, 2019, 8:21 a.m.