Description Objects from the Class Slots Methods Author(s) See Also Examples
Class Ragraph
is used to handle libgraph
representations of R graph objects.
Objects can be created by calls to the function agopen
.
agraph
:Object of class "externalptr"
: A C
based structure containing the libgraph information
laidout
:Object of class "logical"
: Whether or
not this graph has been laid out or not.
layoutType
:Object of class "character"
: The
layout method used for this object
edgemode
:Object of class "character"
: The
edgemode for this graph - “directed” or
“undirected”
AgNode
:Object of class "list"
: A list of
AgNode
objects.
AgEdge
:Object of class "list"
: A list of
AgEdge
objects.
boundBox
:Object of class "boundBox"
: Defines
the bounding box of the plot.
bg
:Object of class "character"
: The background
color.
fg
:Object of class "character"
: The foreground
color.
signature(object = "Ragraph")
: A brief summary of
the contents
signature(object = "Ragraph")
: Returns the
external libgraph pointer
signature(object = "Ragraph")
: Returns the
laidout
slot
signature(object = "Ragraph")
: Returns the
bounding box.
signature(object = "Ragraph")
: Returns the edge
list.
signature(object = "Ragraph")
: Returns the node
list.
signature(object = "Ragraph")
: Retrieves the
edgemode of this object.
signature(object = "Ragraph")
: Retrieves the
method used for the layout of this graph.
signature(object = "Ragraph")
: Returns a
vector of the names of the edges in this graph.
signature(self= "Ragraph")
:
Gets default attributes of the given graph.
signature(self= "Ragraph", attr="vector", value="vector")
:
Sets default attributes of the given graph.
signature(self= "Ragraph", attr="vector")
:
Gets attributes of the given graph.
signature(self= "Ragraph", attr="vector", value="vector")
:
Sets attributes of the given graph.
signature(self= "Ragraph", cluster="numeric", attr="vector")
:
Gets attributes of a cluster for the given graph.
signature(self= "Ragraph", cluster="numeric", attr="vector", value="vector")
:
Sets attributes of a cluster for the given graph.
signature(self= "Ragraph",attr="missing")
:
Gets default attributes of the given edge.
signature(self= "Ragraph", attr="vector", value="vector")
:
Sets default attributes of the given edge.
signature(self= "Ragraph", from="vector", to="vector", attr="vector")
:
Gets attributes of the given edge.
signature(self= "Ragraph", from="vector", to="vector", attr="vector", value="vector")
:
Sets attributes of the given edge.
signature(self= "Ragraph",attr="missing")
:
Gets default attributes of the given node.
signature(self= "Ragraph", attr="vector", value="vector")
:
Sets default attributes of the given node.
signature(self= "Ragraph", n="vector", attr="vector")
:
Gets attributes of the given node.
signature(self= "Ragraph", n="vector", attr="vector", value="vector")
:
Sets attributes of the given node.
signature(object = "Ragraph")
: Returns a two
element list, the first element contains a numerical vector with
the 'x' positions of every node in this graph, and the second
element contains a numerical vector with the 'y' positions for
every node in the graph.
signature(object = "Ragraph")
: Returns a
vector with the heights of every node in the graph
signature(object = "Ragraph")
: Returns a
vector with the left width of every node in the graph.
signature(object = "Ragraph")
: Returns a
vector with the right width of every node in the graph.
Jeff Gentry and Li Long <li.long@isb-sib.ch>
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 | set.seed(123)
V <- letters[1:10]
M <- 1:4
g1 <- randomGraph(V, M, .2)
z <- agopen(g1,"foo")
z
## The various methods in action
## These methods are all used to obtain positional information about nodes
getNodeXY(z)
getNodeHeight(z)
getNodeLW(z)
getNodeRW(z)
## Retrieve information about the edges in the graph
edgeNames(z)
edgemode(z)
## These get information about the layout
laidout(z)
layoutType(z)
boundBox(z)
## Used to retrieve the entire list of edges or nodes
AgEdge(z)
AgNode(z)
|
Loading required package: graph
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, sd, var, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, basename, cbind, colMeans, colSums, colnames,
dirname, 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,
rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which, which.max, which.min
Loading required package: grid
[1] "A graph with 10 nodes."
$x
[1] 147 62 377 147 147 62 259 195 370 482
$y
[1] 477 387 117 297 207 117 477 27 477 477
[1] 54 54 54 54 54 54 54 54 54 54
[1] 27 27 27 27 27 27 27 27 27 27
[1] 27 27 27 27 27 27 27 27 27 27
[1] "a~b" "a~d" "a~e" "a~f" "a~h" "b~d" "b~e" "b~f" "b~h" "c~h" "d~e" "d~f"
[13] "d~h" "e~f" "e~h" "f~h"
[1] "undirected"
[1] TRUE
[1] "dot"
An object of class "boundingBox"
Slot "botLeft":
x: 0, y: 0
Slot "upRight":
x: 524, y: 504
[[1]]
An edge between b and a with 1 BezierCurve objects:
129,456 114,442 95,421 81,407
[[2]]
An edge between d and a with 1 BezierCurve objects:
147,449 147,415 147,357 147,324
[[3]]
An edge between e and a with 2 BezierCurve objects:
158,452 174,413 201,334 183,270
183,270 179,255 171,240 163,229
[[4]]
An edge between f and a with 2 BezierCurve objects:
121,470 92,463 47,447 26,414
26,414 -27,325 25,194 50,141
[[5]]
An edge between h and a with 3 BezierCurve objects:
170,462 211,435 291,374 291,298
291,298 291,298 291,298 291,206
291,206 291,141 242,77 214,46
[[6]]
An edge between d and b with 1 BezierCurve objects:
81,366 95,352 115,331 129,317
[[7]]
An edge between e and b with 2 BezierCurve objects:
71,361 81,337 96,300 111,270
111,270 118,256 126,241 133,230
[[8]]
An edge between f and b with 1 BezierCurve objects:
62,359 62,308 62,195 62,144
[[9]]
An edge between h and b with 2 BezierCurve objects:
50,362 23,309 -32,175 26,90
26,90 58,43 129,31 168,28
[[10]]
An edge between h and c with 1 BezierCurve objects:
353,104 318,87 254,56 219,39
[[11]]
An edge between e and d with 1 BezierCurve objects:
147,269 147,258 147,245 147,234
[[12]]
An edge between f and d with 2 BezierCurve objects:
133,273 126,262 118,247 111,234
111,234 96,203 81,166 71,142
[[13]]
An edge between h and d with 2 BezierCurve objects:
163,274 170,263 179,248 183,234
183,234 202,171 200,93 197,54
[[14]]
An edge between f and e with 1 BezierCurve objects:
129,186 114,172 95,151 81,137
[[15]]
An edge between h and e with 1 BezierCurve objects:
154,180 163,146 179,86 188,53
[[16]]
An edge between h and f with 1 BezierCurve objects:
84,101 109,85 148,59 173,42
[[1]]
An object of class "AgNode"
Slot "center":
x: 147, y: 477
Slot "name":
[1] "a"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "a"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 6
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[2]]
An object of class "AgNode"
Slot "center":
x: 62, y: 387
Slot "name":
[1] "b"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "b"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 7
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[3]]
An object of class "AgNode"
Slot "center":
x: 377, y: 117
Slot "name":
[1] "c"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "c"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 6
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[4]]
An object of class "AgNode"
Slot "center":
x: 147, y: 297
Slot "name":
[1] "d"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "d"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 7
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[5]]
An object of class "AgNode"
Slot "center":
x: 147, y: 207
Slot "name":
[1] "e"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "e"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 6
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[6]]
An object of class "AgNode"
Slot "center":
x: 62, y: 117
Slot "name":
[1] "f"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "f"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 4
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[7]]
An object of class "AgNode"
Slot "center":
x: 259, y: 477
Slot "name":
[1] "g"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "g"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 7
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[8]]
An object of class "AgNode"
Slot "center":
x: 195, y: 27
Slot "name":
[1] "h"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "h"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 7
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[9]]
An object of class "AgNode"
Slot "center":
x: 370, y: 477
Slot "name":
[1] "i"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "i"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 3
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
[[10]]
An object of class "AgNode"
Slot "center":
x: 482, y: 477
Slot "name":
[1] "j"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "j"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 3
Slot "labelColor":
[1] "black"
Slot "labelFontsize":
[1] 14
Slot "height":
[1] 54
Slot "rWidth":
[1] 27
Slot "lWidth":
[1] 27
Slot "color":
[1] "black"
Slot "fillcolor":
[1] "transparent"
Slot "shape":
[1] "circle"
Slot "style":
[1] ""
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.