hcell2xy {hexbin}R Documentation

Compute X and Y Coordinates for Hexagon Cells

Description

Computes x and y coordinates from hexagon cell id's.

Usage

hcell2xy(bin)

Arguments

bin hexbin object

Details

The hexbin object contains all the needed information. The purpose of this function is to reduce storage. The cost is additional calculation.

Value

A list with two components

x
y

References

see in hcell.

See Also

hcell, hray, hexbin

Examples

x <- rnorm(10000)
y <- rnorm(10000)
bin <- hexbin(x,y)
xys <- hcell2xy(bin)
# temporal trends with confidence bounds plotted on a map
# Illustration only pending access to user functions.
# mtapply()  #like tapply but for matrices
# sens.season.slope()  #computes sen's seasonal slope

## This part does not work and commented out
#bin  <- hcell(dat$x,dat$y)   #  x and y are in map projection units
#newdat < dat[,c('month','year','value')]    # extract columns
#stats <- mtapply(newdat,bin$cell,sens.season.slope,season=12)
#plot(mymap,type='l')       # map boundaries in map projection units
#xy <- hcell2xy(bin)  # x and y coordinates for hexagon cell centers
#hray(xy$x, xy$y,val=stat[,1],lower= stat[,2],upper=stat[,3])

[Package Contents]