hcell                 package:hexbin                 R Documentation

_c_o_m_p_u_t_e _h_e_x_a_g_o_n _c_e_l_l _i_d'_s _f_r_o_m _x _a_n_d _y _m_a_p _p_r_o_j_e_c_t_i_o_n _c_o_o_r_d_i_n_a_t_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Creates an hexbin list containing hexagon cell id's corresponding
     to (x,y) pairs.  Used for partitioning data into hexagon regions
     and computation of statistics for each region.  Provides symbol
     congestion control in maps.

_U_s_a_g_e:

     hcell(x, y, xbins, shape, xbnds, ybnds, verbose = getOption("verbose"))

_A_r_g_u_m_e_n_t_s:

       x: a vector of numbers.  The first coordinate of bivariate data
          for cell id computation.

       y: a vector of numbers.  The second coordinate of bivariate data
          for cell id computation. 

   xbins: number of  hexagon cells partitioning the range of xbnds.

   xbnds: horizontal limits of the region in x units.

   ybnds: vertical limits of the region in y units.

   shape: number giving shape=yheight/xwidth of the plotting region.

 verbose: logical indicating if some diagnostic output should happen.

_D_e_t_a_i_l_s:

     The plot shape must be maintained for hexagons to appear with
     equal sides.  Calculations are in single precision.

_V_a_l_u_e:

     an object of class hexbin. The list structure typically contains
     the following components: 

    cell: A vector of cell ids to supply to the table function

   xbins: number of hexagons across the x axis.  hexagon inner diameter
          =diff(xbnds) / xbins in x units 

   xbnds: x coordinate bounds for binning and plotting

   ybnds: y coordinate bounds for binning and plotting

   shape: plot shape= yheight(inches) / xwidth(inches)

_R_e_f_e_r_e_n_c_e_s:

     Carr, D. B., A. R. Olsen, and D. White  (1992) "Hexagon Mosaic
     Maps for Display of Univariate and Bivariate Geographical Data." 
     _Cartography and Geographic Information Systems_, Vol. 19 No. 4,
     pp. 228-236, 271

_S_e_e _A_l_s_o:

     hcell2xy, hgrid, hray, hexbin

_E_x_a_m_p_l_e_s:

     x <- rnorm(1000)
     y <- rnorm(1000)
     rangex <- range(x)
     rangey <- range(y)
     diffx <- diff(rangex)
     diffy <- diff(rangey)
     bin <- hcell(x, y, xbnds = rangex, ybnds = rangey, shape = diffy/diffx)

