extracts the label layer from a netify plot components object. labels display actor names or other text annotations with background boxes, making them more visible against complex network backgrounds.
Value
a custom object of class "netify_label" that can be added to a ggplot object using the + operator. the object contains the label layer with all its aesthetic mappings and data.
Examples
# \donttest{
# create a netify object
mat <- matrix(c(NA, 1, 0, 0, NA, 1, 1, 0, NA), 3, 3,
dimnames = list(c("alice", "bob", "carol"),
c("alice", "bob", "carol")))
net <- new_netify(mat, symmetric = FALSE)
# get plot components with labels
comp <- plot(net, add_label = TRUE, return_components = TRUE)
# build custom plot with labels
library(ggplot2)
ggplot() +
netify_label(comp)
# }