geom_neighbors {chessboard} | R Documentation |
Highlight neighbors on a chessboard
Description
Highlights neighbors (cells) on a chessboard plotted with gg_chessboard()
.
Usage
geom_neighbors(nodes, neighbors)
Arguments
nodes |
a |
neighbors |
a |
Value
A geom_point
that must be added to a ggplot2
object.
Examples
library("chessboard")
# Two-dimensional sampling ----
sites_infos <- expand.grid("transect" = 1:3, "quadrat" = 1:5)
nodes <- create_node_labels(data = sites_infos,
transect = "transect",
quadrat = "quadrat")
neighbors <- pawn(nodes, focus = "2-3")
gg_chessboard(nodes) +
geom_node(nodes, "2-3") +
geom_neighbors(nodes, neighbors)
[Package chessboard version 0.1 Index]