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

hcell2xyInt

Change cell ids to 2d integer coordinate system


Description

Transforms the cell representation of a a lattice into a 2d integer coordinate system.

Usage

hcell2xyInt(hbin, xbins=NULL, xbnds=NULL, ybnds=NULL, shape=NULL)

Arguments

hbin

a object of class "hexbin", typically produced by hexbin(*).

xbins

the number of bins partitioning the range of xbnds.

xbnds, ybnds

horizontal and vertical limits of the binning region in x or y units respectively; must be numeric vector of length 2.

shape

the shape = yheight/xwidth of the plotting regions.

Details

Takes a grid defined by either the hexbin parameters or dimen in a hexbin object and translates the cell ids for the grid into 2d integer coordinates.

Value

An integer matrix with two columns, i and j representing the integer xy coordinates of the hexagon grid.

i

Integer coordiante of the rows, increases from bottom to top

j

Integer coordiante of the columns, increases from left to right

Author(s)

Nicholas Lewin-Koh

See Also

Examples

x<-rnorm(10000)
 y<-rnorm(10000)
 hbin<-hexbin(x,y)
 ijInt<-hcell2xyInt(hbin)

hexbin

Hexagonal Binning Routines

v1.28.2
GPL-2
Authors
Dan Carr <dcarr@voxel.galaxy.gmu.edu>, ported by Nicholas Lewin-Koh and Martin Maechler <maechler@stat.math.ethz.ch>, contains copies of lattice functions written by Deepayan Sarkar <deepayan.sarkar@r-project.org>
Initial release

We don't support your browser anymore

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