agwrite: Read / write Ragraph objects

Description Usage Arguments Details Author(s) See Also Examples

View source: R/writers.R

Description

These functions will write an Ragraph object to or from a file.

Usage

1
2
agwrite(graph, filename)
agread(filename, layoutType="dot", layout=TRUE)

Arguments

graph

An object of class Ragraph

filename

The input or output filename

layoutType

character(1) specifying the format of the input file. must be one of graphvizCapabilities()$layoutTypes.

layout

logical(1) indicating whether graphLayout is to be called on the result of file input.

Details

These function are wrappers to agwrite() and agread() calls in Graphviz.

Author(s)

Jeff Gentry

See Also

agopen, agread

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
V <- letters[1:10]
M <- 1:4
g1 <- randomGraph(V, M, .2)
z <- agopen(g1, "foo", layout=FALSE) ## default layoutType 'dot'
file <- tempfile()
agwrite(z, file)


## supported input types
graphvizCapabilities()$layoutTypes
g2 <- agread(file, layout=TRUE)
if (interactive())
   plot(g2)

Example output

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
NULL
[1] "dot"   "circo" "fdp"   "neato" "osage" "twopi"

Rgraphviz documentation built on Nov. 8, 2020, 8:21 p.m.