-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmg_to_igraph.Rd
43 lines (38 loc) · 1.41 KB
/
mg_to_igraph.Rd
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
40
41
42
43
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mg_to_igraph.R
\name{mg_to_igraph}
\alias{mg_to_igraph}
\alias{mg_to_igraph.mgNetwork}
\alias{mg_to_igraph.mgNetworksCollection}
\title{Coerce \code{mgNetworksCollection} or \code{mgNetwork} objects to \code{igraph} objects.}
\usage{
mg_to_igraph(x, ...)
\method{mg_to_igraph}{mgNetwork}(x, ...)
\method{mg_to_igraph}{mgNetworksCollection}(x, ...)
}
\arguments{
\item{x}{either a \code{mgNetworksCollection} or a \code{mgNetwork} object.}
\item{...}{currently ignored.}
}
\value{
An object of class \code{igraph} for a \code{mgNetwork} object and a list of
\code{igraph} objects for \code{mgNetworksCollection}.
}
\description{
Coerce \code{mgNetworksCollection} or \code{mgNetwork} objects to \code{igraph} objects.
}
\section{Methods (by class)}{
\itemize{
\item \code{mgNetwork}: Convert\code{mgNetwork} objects to \code{igraph} objects.
\item \code{mgNetworksCollection}: Convert \code{mgNetworksCollection} objects to \code{igraph} objects.
}}
\examples{
insects_networks <- get_collection(search_networks(query='insect\%'))
# Apply mg_to_igraph on one specific network
insects_network <- insects_networks[[1]]
ig_network <- mg_to_igraph(insects_network)
# Apply mg_to_igraph on networks collection
ig_coll_networks <- mg_to_igraph(insects_networks)
# Plot igraph object with vertex label
plot(ig_network, vertex.label = insects_network$nodes$taxonomy.name)
}