View source: R/build_dynamic_networks.R
build_dynamic_networks | R Documentation |
build_network()
creates a network from a table of nodes and its
directed edges. That is a special case of the more general build_dynamic_networks()
.
This function creates one or several tibble graphs (built with
tidygraph) from a table of nodes and its
directed edges. For instance, for bibliometric networks, you can give a list of
articles and the list of the references these articles cite. You can use it to
build a single network or multiple networks over different time windows.
build_dynamic_networks( nodes, directed_edges, source_id, target_id, time_variable = NULL, time_window = NULL, cooccurrence_method = c("coupling_angle", "coupling_strength", "coupling_similarity"), overlapping_window = FALSE, edges_threshold = 1, compute_size = FALSE, keep_singleton = FALSE, filter_components = FALSE, ..., verbose = TRUE ) build_network( nodes, directed_edges, source_id, target_id, cooccurrence_method = c("coupling_angle", "coupling_strength", "coupling_similarity"), edges_threshold = 1, compute_size = FALSE, keep_singleton = FALSE, filter_components = FALSE, ... )
nodes |
The table with all the nodes and their metadata. For instance, if your nodes are articles, this table is likely to contain the year of publication, the name of the authors, the title of the article, etc... The table must have one row per node. |
directed_edges |
The table with of all the elements to which your nodes are connected. If your nodes are
articles, the |
source_id |
The quoted name of the column with the unique identifier of each node. For instance,
for a bibliographic coupling network, the id of your citing documents. It corresponds
to the |
target_id |
The quoted name of the column with the unique identifier of each element connected to the node (for
instance, the identifier of the reference cited by your node if the node is an article).
It corresponds to the |
time_variable |
The column with the temporal variable you want to use to build your windows for the
succession of networks. By default, |
time_window |
The length of your network relatively of the unity of the |
cooccurrence_method |
Choose a cooccurrence method to build your indirect edges table. The function propose three methods that depends on the biblionetwork package and three methods that are implemented in it:
|
overlapping_window |
Set to |
edges_threshold |
Threshold value for building your edges. With a higher threshold, only the stronger links
will be kept. See the biblionetwork package
documentation and the |
compute_size |
Set to |
keep_singleton |
Set to |
filter_components |
Set to |
... |
Additional arguments from |
verbose |
Set to |
build_network()
has been added for convenience but it is just
a special case of the more general build_dynamic_networks()
, with
If time_window
is NULL
, the function computes only
one network and return a tidygraph object built with tbl_graph().
If time_variable
and time_window
are not NULL
, the function returns a list
of tidygraph networks, for each time window.
library(networkflow) nodes <- Nodes_stagflation |> dplyr::rename(ID_Art = ItemID_Ref) |> dplyr::filter(Type == "Stagflation") references <- Ref_stagflation |> dplyr::rename(ID_Art = Citing_ItemID_Ref) temporal_networks <- build_dynamic_networks(nodes = nodes, directed_edges = references, source_id = "ID_Art", target_id = "ItemID_Ref", time_variable = "Year", cooccurrence_method = "coupling_similarity", time_window = 20, edges_threshold = 1, overlapping_window = TRUE) temporal_networks[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.