Learn R Programming

hexDensity (version 1.4.8)

hexbinFull: Hexagonal binning with whole grid output.

Description

Adapted from hexbin to output hexagons with 0 count, and also to allow points with different weights. Default to use regular hexagon. See hexbin for extra detail on the output.

Usage

hexbinFull(
  x,
  y = NULL,
  xbins = 128,
  shape = NULL,
  xbnds = range(x),
  ybnds = range(y),
  xlab = NULL,
  ylab = NULL,
  IDs = FALSE,
  weight = NULL
)

Value

an S4 object of class hexbin.

Arguments

x, y

Coords of the points or a single plotting structure to be used in binning. See xy.coords.

xbins

Number of bins in a row.

shape

shape = yheight/xwidth of the plotting regions

xbnds, ybnds

Horizontal and vertical limits of the binning region in x or y units respectively, must encompass range(x) or range(y) respectively; Vector of length 2

xlab, ylab

Optional character strings used as labels for x and y. If NULL, sensible defaults are used.

IDs

Logical indicating if the hexagonal cell ID for each point should be returned, see hexbin.

weight

Numeric weight vector to be assigned to points.

Author

Dan Carr <dcarr@voxel.galaxy.gmu.edu>; ported and extended by Nicholas Lewin-Koh <nikko@hailmail.net>. Modified by Quoc Hoang Nguyen <nguyen.q@wehi.edu.au> for hexDensity.

References

Carr, D. B. et al. (1987) Scatterplot Matrix Techniques for Large N. JASA 83, 398, 424--436.

Examples

Run this code
set.seed(133)
d=hexbinFull(x=rnorm(20000),y=rnorm(20000),xbins=50)
plotHexDensity(d)

Run the code above in your browser using DataLab