This function plots a comparison of the motif counts in a given network with the motif counts in a baseline model.
compare_to_baseline(
net,
motifs,
n = 10,
lvl_attr = "sesType",
assume_sparse = TRUE,
model = "erdos_renyi",
level = -1,
ergm_model = NULL,
directed = NULL
)network object
list of motif identifier strings
number of random graphs used in baseline model
character vector specifying the attribute name where level
information is stored in net.
whether the random graphs shall be assumed to be sparse. used to find ideal counting function
baseline model to be used. Options are 'erdos_renyi', 'actors_choice',
'ergm', 'partial_ergm' and fixed_densities'.
See vignette("random_baselines") for more details.
Defaults to 'erdos_renyi'.
lvl_attr of the variable level for the Actor's Choice model
ergm model as for example fitted by calling
ergm::ergm() on the empirically observed network.
Needs to be supplied when model is set to ergm.
whether the graph shall be treated as a directed graph. Per
default (NULL), this is determined automatically using the structure
of the provided network object
data frame with one row for each motif identifier string and one row for every computed random graph
Note that when using the Actor's Choice model this function does not choose
the variable level automatically. Use the level parameter to provide a
valid level.
When using ERGM the parameter net is not used. Networks to create the
baseline from are sampled in R using the ergm_model parameter.
# NOT RUN {
compare_to_baseline(ml_net, list("1,2[I.C]", "1,2[II.C]"), directed = FALSE)
# }
Run the code above in your browser using DataLab