as.hexagons: Expand hexagon centerpoint grid into hexagon vertices

Description Usage Arguments Value Author(s) Examples

Description

This function expands a data frame of hexagonal tiling centerpoints into one containing hexagon vertices suitable for plotting with geom_polygon. The columns containing the x and y coordinates of the centerpoints are specified in the formula, y~x. The groupvar parameter names a new column in the output containing the hexagon id (i.e., aes(group=groupvar)).

Usage

1
as.hexagons(data, formula = y ~ x, groupvar = "cell")

Arguments

data

dataframe

formula

formula defining the columns with centerpoint data

groupvar

name for new column with hexagon group index

Value

a new data frame with 6*nrow(data) rows and ncol(data)+1 columns

Author(s)

Grady Weyenberg

Examples

1
lungfish.hex <- as.hexagons(lungfish.tops$simplex)

grady/geophyttertools documentation built on May 17, 2019, 8:01 a.m.