View source: R/search_interactions.R
| search_interactions | R Documentation |
Search for specific interactions using a keyword or a specific type of
interactions (e.g. mutualism). If the query is a character string, then all character columns in the table
are searched and the entries for which at least one
partial match was found are returned.
Alternatively, a named list can be used to look for an exact match in a specific column (see Details section)
search_interactions(
query,
type = NULL,
expand_node = FALSE,
verbose = TRUE,
...
)
query |
either a character string including a single keyword or a named list containing a custom query (see details section below). Note that if an empty character string is passed, then all datasets available are returned. |
type |
a |
expand_node |
a logical. Should the function returned extra information pertaining to nodes? Default is set to |
verbose |
a |
... |
further arguments to be passed to |
Names of the list should match one of the column names within the table.
For the interaction table, those are:
id: unique identifier of the interaction;
attr_id: identifier of a specific attribute;
direction: edge direction ("directed", "undirected" or "unknown");
network_id: Mangal network identifier;
node_from: node id which the interaction end to;
node_to: node to which the interaction end to;
type: use argument type instead.
Note that for lists with more than one element, only the first element is
used, the others are ignored. The type of interactions (argument type)
currently available are the following
"competition";
"amensalism";
"neutralism";
"commensalism";
"mutualism";
"parasitism";
"predation";
"herbivory";
"symbiosis";
"scavenger";
"detritivore".
An object of class mgSearchInteractions, i.e. a data.frame object including interactions.
All networks in which interactions are involved are also attached to the data.frame.
df_inter <- search_interactions(type = "competition", verbose = FALSE)
# Get all networks containing competition
competition_networks <- get_collection(df_inter, verbose = FALSE)
df_net_926 <- search_interactions(list(network_id = 926), verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.