| to_cograph | R Documentation |
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").
to_cograph(edges, nodes = NULL, directed = FALSE)
edges |
A data frame with at least |
nodes |
Optional data frame of node attributes with an |
directed |
Logical. Default |
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.
A cograph_network object (S3 list with $nodes and $edges).
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.