hex_coord: Generate hexagon coordinates.

Description Usage Arguments Details Value Examples

Description

Generate hexagon coordinates.

Usage

1

Arguments

x

horizontal position of center

y

vertical position of center

width

hex width

height

hex height

Details

Long axis is horizontal. Edges clock-wise from far-left, separated by row of missing values.

Value

A two column matrix with 7 times as many rows as input.

Examples

1
2
3
4
5
6
7
8
x <- runif(1000)
y <- runif(1000)
res <- unique(hex_pos(x, y, 0.5, 0.5))
hexes <- hex_coord(res[, 1], res[, 2], 0.5, 0.5)

plot(hexes, type = "n")
polygon(hexes)
points(res)

hadley/densityvis documentation built on May 17, 2019, 9:56 a.m.