Description Usage Arguments Value Author(s) Examples
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)
).
1 | as.hexagons(data, formula = y ~ x, groupvar = "cell")
|
data |
dataframe |
formula |
formula defining the columns with centerpoint data |
groupvar |
name for new column with hexagon group index |
a new data frame with 6*nrow(data) rows and ncol(data)+1 columns
Grady Weyenberg
1 | lungfish.hex <- as.hexagons(lungfish.tops$simplex)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.