Learn R Programming

beeswarm (version 0.0.7)

smile: Spread out 1-d data such that all points are visible

Description

Spread out a 1-dimensional vector into two dimensions such that all points are visible.

Usage

smile(x, xsize, ysize)

Arguments

x
A vector of values.
xsize
Size of the plotting character in the direction along which x is plotted.
ysize
Size of the plotting character in the perpedicular direction

Value

  • A vector of the same length as x.

Details

...

See Also

beeswarm

Examples

Run this code
## Plot points in one dimension
x <- rep(0, 100)
y <- rnorm(100)
plot(x, y, xlim = c(-1, 2))

## Add smile-transformed points
xs <- smile(y, xsize = yinch(0.08), ysize = xinch(0.08))
points(xs + 1, y, col = 2)

Run the code above in your browser using DataLab