[73f552]: / man / get_interaction_from_database.Rd

Download this file

40 lines (33 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_interaction_from_database.R
\name{get_interaction_from_database}
\alias{get_interaction_from_database}
\title{Get interaction from database}
\usage{
get_interaction_from_database(X, db = NULL, type = "db", user.ego = FALSE)
}
\arguments{
\item{X}{vector of nodes or list of vectors}
\item{db}{data.frame (with two columns: from, to) or igraph}
\item{type}{character added to node metadata}
\item{user.ego}{logical, if user.ego == TRUE looks for first degree neighbors
in db and add 'mode' metadata ('core'/'extended')}
}
\value{
a subset graph of db from X list of nodes
}
\description{
Returns an interaction graph from a vector of nodes (or a list of vectors)
and an interaction database (data.frame or igraph)
}
\examples{
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)
}