Converts a bibnets edge list to a cograph_network object by calling
cograph::as_cograph(). Optionally merges node metadata (e.g., from
local_citations()) into the network's node table so attributes like
lcs or year can be used directly in splot() aesthetic parameters
(e.g., node_size = "lcs").
Arguments
- edges
A data frame with at least
from,to,weightcolumns.- nodes
Optional data frame of node attributes with an
idcolumn (e.g., output oflocal_citations()). All columns are merged into thecograph_network$nodestable and become available as aesthetic mappings.- directed
Logical. Default
FALSE.
Details
Note: bibnets edge lists (from, to, weight) are accepted directly
by cograph::splot() without conversion. This function is only needed
when you want to attach node-level metadata.
Examples
data(biblio_data)
# Without metadata: splot() accepts bibnets edges directly
edges <- author_network(biblio_data, "collaboration")
# With metadata: document network + local citation scores as node size
edges <- document_network(biblio_data, type = "coupling")
nodes <- local_citations(biblio_data) # keyed by document id
net <- to_cograph(edges, nodes = nodes)