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

jitterXY

Add random noise to data based on graphics character size


Description

The input data, for x or y axis data, is jittered by a uniform random amount, scaled to the width and height of a character if this data were being plotted.

Usage

jitterXY(x = c(0, 1), y = c(0, 1), xscale = 1, yscale = 1)
jitterX(x, scale = 1)
jitterY(y, scale = 1)

Arguments

x

Numeric data that might be plotted on the horizontal axis.

y

Numeric data that might be plotted on the vertical axis.

xscale, yscale, scale

How much to scale the random noise on the x, y axis

Value

For jitterXY a list, with x and y components containing the perturbed versions of the corresponding arguments. Giving this list to plot produces a scatter plot of the two sets of data. If only one coordinate is jittered a vector is returned; this is always the case with jitterX and jitterY.

See Also

jitter, which scales data without regard to the plotting parameters.

Examples

## Not run: 
  with(sotu, plot(jitterXY(economy, war+peace)))

## End(Not run)

SoDA

Functions and Examples for "Software for Data Analysis"

v1.0-6.1
GPL (>= 2)
Authors
John M Chambers
Initial release
2014-06-12

We don't support your browser anymore

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