Description Usage Arguments Value Author(s) See Also Examples
Reads a graph-object to a file and write graph-object to file
1 2 3 4 5 6 7 8 9 |
filename |
The filename of the graph. |
graph |
An |
mode |
The mode of the file; ascii-file or a (gzip-compressed) binary. Default value depends on
the inla.option |
object |
An |
x |
An |
y |
Not used |
size.only |
Only read the size of the graph |
... |
Additional arguments. In |
The output of inla.read.graph
, is an inla.graph
object, with elements
n |
is the size of the graph |
nnbs |
is a vector with the number of neigbours |
nbs |
is a list-list with the neigbours |
cc |
list with connected component information (this entry can be auto-generated; see below)
|
The connected component information, can be generated from the rest of the graph-structure,
using graph = inla.add.graph.cc(graph)
if you manually construct the inla.graph
-object.
Methods implemented for inla.graph
are summary
and plot
.
The method plot
require the libraries Rgraphviz
and graph
from the Bioconductor-project,
see http://www.bioconductor.org.
Havard Rue hrue@math.ntnu.no
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## a graph on a file
cat("3 1 1 2 2 1 1 3 0\n", file="g.dat")
g = inla.read.graph("g.dat")
## writing an inla.graph-object to file
g.file = inla.write.graph(g, mode="binary")
## re-reading it from that file
gg = inla.read.graph(g.file)
summary(g)
plot(g)
inla.spy(g)
## when defining the graph directly in the call, we can use a mix of character and numbers
g = inla.read.graph(c(3, 1, "1 2 2 1 1 3", 0))
inla.spy(c(3, 1, "1 2 2 1 1 3 0"))
inla.spy(c(3, 1, "1 2 2 1 1 3 0"), reordering=3:1)
inla.write.graph(c(3, 1, "1 2 2 1 1 3 0"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.