geom_edges {chessboard} | R Documentation |
Link neighbors by arrow on a chessboard
Description
Links neighbors (cells) on a chessboard plotted with gg_chessboard()
.
Usage
geom_edges(nodes, focus, neighbors)
Arguments
nodes |
a |
focus |
an |
neighbors |
a |
Value
A geom_segment
that must be added to a ggplot2
object.
Examples
library("chessboard")
sites_infos <- expand.grid("transect" = 1:9, "quadrat" = 1:9)
nodes <- create_node_labels(data = sites_infos,
transect = "transect",
quadrat = "quadrat")
focus <- "5-5"
neighbors <- wizard(nodes, focus = focus, degree = 4, directed = FALSE,
reverse = TRUE)
gg_chessboard(nodes) +
geom_neighbors(nodes, neighbors) +
geom_edges(nodes, focus, neighbors) +
geom_node(nodes, focus)
[Package chessboard version 0.1 Index]