Description Details Slots Extends Constructor Methods Author(s) See Also Examples

This is a class of graphs that are represented in terms of nodes and an edge list. This is a suitable representation for a graph with a large number of nodes and relatively few edges.

The `graphNEL`

class provides a very general structure for
representing graphs. It will be reasonably efficient for lists with
relatively more nodes than edges. Although this representation can
support multi-edges, such support is not implemented and instances
of `graphNEL`

are assumed to be simple graphs with at most one
edge between any pair of nodes.

The `edgeL`

is a named `list`

of the same length as the
node vector. The names are the names of the nodes. Each element of
`edgeL`

is itself a list. Each element of this (sub)list is a
vector (all must be the same length) and each element represents an
edge to another node. The sublist named `edges`

holds index
values into the node vector. And each such entry represents an edge
from the node which has the same name as the component of
`edgeL`

to the node with index provided. Another component that
is often used is named `weights`

. It represents edge weights.
The user can specify any other edge attributes (such as types
etc). They are responsible for any special handling that
these might require.

For an `undirected`

instance all edges are reciprocated (there
is an edge from A to B and from B to A).

Note that the reason for using indices to represent the `to`

end
of a node is so that we can easily support permutation of the node
labels as a way to generate randomizations of the graph.

`nodes`

:Object of class

`"vector"`

.`edgeL`

:Object of class

`"list"`

. The`edgeL`

must be the same length as`nodes`

. The elements of this vector correspond to the same element in`nodes`

. The elements are themselves lists. If the node has any edges then this list will have an element named`edges`

. This will eventually change. Since edge weights are now stored in the edge attributes construct, we do not need the extra level of list.

Class `"graph"`

, directly.

`graphNEL(nodes=character(), edgeL=list(), edgemode='undirected')`

creates a graphNEL instance.

- nodes
A character vector of node labels.

- edgeL
A named list either in the format returned by the

`edges`

method or a list of lists where each inner list has an element named`edges`

and optionally an element named`weights`

. If`weights`

is present, it must be the same length as the`edges`

element.- edgemode
Either "directed" or "undirected".

- adj
`signature(object = "graphNEL")`

: A method for finding nodes adjacent to the suplied node.- edgeL
`signature(graph = "graphNEL")`

: A method for obtaining the edge list.- edgeWeights
`signature(object = "graphNEL")`

: A method for obtaining the edge weights.- edges
`signature(object = "graphNEL")`

: A method for obtaining the edges.- inEdges
`signature(node = "character", object = "graphNEL")`

: Return the incoming edges for the specified nodes. See`inEdges`

.- nodes
`signature(object = "graphNEL")`

: A method for obtaining the nodes.- numNodes
`signature(object = "graphNEL")`

:A method for determining how many nodes are in the graph.- subGraph
`signature(snodes="character", graph = "graphNEL")`

:A method for obtaining the induced subgraph based on the set of supplied nodes and the supplied graph.- plot
Please see the help page for

`plot.graphNEL`

in the`Rgraphviz`

package- graph2graphviz
`signature(object = "graphNEL")`

: A method that will convert a`graphNEL`

object into a matrix suitable for interaction with`Rgraphviz`

. Not intended to be called directly. This function will insure that no NA's (or other undesired values) are in the graph, or created by coersion.- nodes<-
`signature(object="graphNEL", value="character")`

: A method for replacing the nodes in a graph object. It checks to be sure the values are the right length and unique.- coerce
`signature(from = "graphNEL", to = "graphAM")`

: Called via`as`

, the method converts to an adjacency matrix representation. See`graphAM-class`

.- coerce
`signature(from = "graphNEL", to = "graphBAM")`

: Called via`as`

, the method converts to an bit array representation. See`graphBAM-class`

.

R. Gentleman

`graphAM-class`

, `distGraph-class`

,
`clusterGraph-class`

1 2 3 4 5 6 7 8 9 |

```
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit, which, which.max, which.min
$A
[1] "D"
$B
[1] "C"
$C
[1] "B"
$D
[1] "A"
$A
D
0.8830174
$B
C
0.4089769
$C
B
0.7883051
$D
A
0.2875775
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.