spatialEco (version 1.3-2)

hexagons: Hexagons

Description

Create hexagon polygons

Usage

hexagons(x, res = 100, ...)

Arguments

x

sp SpatialDataFrame class object

res

Area of resulting hexagons

...

Additional arguments passed to spsample

Value

SpatialPolygonsDataFrame OBJECT

Examples

Run this code
# NOT RUN {
require(sp)
  data(meuse)
    coordinates(meuse) <- ~x+y 

hex.polys <- hexagons(meuse, res=100)   
  plot(hex.polys)
    plot(meuse,pch=20,add=TRUE)

# Points intersecting hexagons  
hex.pts <- na.omit(over(meuse,hex.polys))
(hex.pts <- data.frame(PTID=rownames(hex.pts), hex.pts)) 

# }

Run the code above in your browser using DataCamp Workspace