There are, as far as I know, two functions from R to hexbin: hexBinning and geom_hex in the fMultivar and ggplot2 packages, respectively. And both parameterize the centers of the hexagons in accordance with the coordinates of the lower lower left point in the sample.
This means that if you divide your sample (depending on the factor or, in my case, inside the mapreduce task), your hexagons will become eccentric.
So, I implemented my own hexbin function, which assumes (0,0) as the center of the grid (i.e. if there were points around (0,0), the corresponding hexagon would be centered there) and only requires r (the radius of the hexagon) as a parameter.
The implementation is here (sorry, Spanish text!). Moreover, my implementation has no explicit loops: it is fully vectorized.
datanalytics.com
source share