File: subGraph.Rd

package info (click to toggle)
r-bioc-graph 1.60.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,076 kB
  • sloc: ansic: 842; makefile: 12; sh: 3
file content (44 lines) | stat: -rw-r--r-- 1,191 bytes parent folder | download | duplicates (6)
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
44
\name{subGraph}
\alias{subGraph}
\alias{subGraph,character,graphNEL-method}
\alias{subGraph,character,clusterGraph-method}
\alias{subGraph,character,distGraph-method}
\alias{subGraph,character,MultiGraph-method}
\alias{subGraph,character,graphBAM-method}
\title{Create a Subgraph  }
\description{
  Given a set of nodes and a graph this function creates
  and returns subgraph with only the supplied nodes and any edges
  between them.
}
\usage{
subGraph(snodes, graph)
}
\arguments{
  \item{snodes}{A \code{character} vector of node labels. }
  \item{graph}{A graph object, it must inherit from the \code{graph} class. }
}
\details{
  The returned subgraph is a copy of the graph. Implementations for
  Implementations for \code{graphNEL}, \code{distGraph} and
  \code{clusterGraph}. 
}
\value{
  A graph of the same class as the \code{graph} argument but with only
  the supplied nodes.
}
\author{R. Gentleman }

\seealso{ \code{\link{nodes}},\code{\link{edges}} }

\examples{
        set.seed(123)
        x <- rnorm(26)
        names(x) <- letters
        library(stats)
        d1 <- dist(x)
        g1 <- new("distGraph", Dist=d1)
        subGraph(letters[1:5], g1)

}
\keyword{manip}