View source: R/get_interaction_from_database.R
get_interaction_from_database | R Documentation |
Returns an interaction graph from a vector of nodes (or a list of vectors) and an interaction database (data.frame or igraph)
get_interaction_from_database(X, db = NULL, type = "db", user.ego = FALSE)
X |
vector of nodes or list of vectors |
db |
data.frame (with two columns: from, to) or igraph |
type |
character added to node metadata |
user.ego |
logical, if user.ego == TRUE looks for first degree neighbors in db and add 'mode' metadata ('core'/'extended') |
a subset graph of db from X list of nodes
X <- letters[1:4]
db <- as.data.frame(list(from = sample(letters[1:10], replace = TRUE),
to = sample(letters[1:10], replace = TRUE)))
sub <- get_interaction_from_database(X,
db)
db.graph <- igraph::graph_from_data_frame(db,
directed=FALSE)
sub <- get_interaction_from_database(X,
db)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.