Returns a dataframe with one row for each instance of the motif specified by the given motif identifier string. If the identifier string specifies a motif class, e.g. 1,2[I.A], then only motifs of the given class are returned. If the identifier string specifies a signature, e.g. 1,2, then a full list of all motifs of this signature is returned. In the latter case, the dataframe contains an additional column stating the classes of the motifs. The naming scheme of the columns is as follows: Each column is called levelA_nodeB where A is the lvl_attr of the nodes in the column and B the index of the nodes among the nodes on the same level. This index stems from the internal order of the nodes and does not carry any specific meaning.

list_motifs(net, identifier, lvl_attr = "sesType", directed = NULL)

Arguments

net

network object

identifier

motif identifier string (with or without class, see above)

lvl_attr

character vector specifying the attribute name where level information is stored in net.

directed

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

Value

data frame with one row for each motif

Examples

# \dontrun{ head(list_motifs(ml_net, "1,2[I.C]", directed = FALSE))
#> level0_node0 level1_node0 level1_node1 #> 1 SpatPlanA actor4 actor8 #> 2 SpatPlanA actor4 actor18 #> 3 SpatPlanA actor4 actor31 #> 4 SpatPlanA actor4 actor41 #> 5 SpatPlanA actor4 actor46 #> 6 SpatPlanA actor8 actor18
# }