Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tukeyTexture

Generate random positions based on Tukey texture algorithm


Description

Generate partly random, partly constrained lateral displacements based on Tukey texture algorithm from Tukey and Tukey 1990

Usage

tukeyTexture(x, jitter = TRUE, thin = FALSE, hollow = FALSE,
  delta = diff(stats::quantile(x, c(0.25, 0.75))) * 0.03)

Arguments

x

the points to be jittered. really only used to calculate length

jitter

if TRUE add random jitter to each point

thin

if TRUE then push points to the center in thin regions

hollow

if TRUE then expand points outward to avoid “hollowness”

delta

a “reasonably small value” used in edge straightening and thinning

Value

a vector of length length(x) giving displacements for each corresponding point in x

Examples

x<-rnorm(200)
plot(tukeyTexture(x),x)
x<-1:100
plot(tukeyTexture(x),x)
plot(tukeyTexture(log10(counties$landArea),TRUE,TRUE),log10(counties$landArea),cex=.25)

vipor

Plot Categorical Data Using Quasirandom Noise and Density Estimates

v0.4.5
GPL (>= 2)
Authors
Scott Sherrill-Mix, Erik Clarke
Initial release
2017-03-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.