makeNodeAttrs: make a list of character vectors that can be used as a value...

Description Usage Arguments Details Value Author(s) Examples

View source: R/attrs.R

Description

make a list of character vectors that can be used as a value for the nodeAttrs argument in agopen

Usage

1
2
makeNodeAttrs(g, label = nodes(g), shape = "ellipse",
              fillcolor = "#e0e0e0", ...)

Arguments

g

graph

label

character of length either 1 or numnodes(g). If the length is 1, the value is recycled.

shape

character of length either 1 or numnodes(g)

fillcolor

character of length either 1 or numnodes(g)

...

further named arguments that are character vectors of length either 1 or numNodes(g)

Details

This function is trivial but convenient.

Value

A list of named character vectors, each of which with length numNodes(g).

Author(s)

Wolfgang Huber <[email protected]>

Examples

1
2
g <- randomEGraph(letters[1:10], p=0.2)
makeNodeAttrs(g)

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, cbind, colMeans, colSums, 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, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: grid
$label
  a   b   c   d   e   f   g   h   i   j 
"a" "b" "c" "d" "e" "f" "g" "h" "i" "j" 

$shape
        a         b         c         d         e         f         g         h 
"ellipse" "ellipse" "ellipse" "ellipse" "ellipse" "ellipse" "ellipse" "ellipse" 
        i         j 
"ellipse" "ellipse" 

$fillcolor
        a         b         c         d         e         f         g         h 
"#e0e0e0" "#e0e0e0" "#e0e0e0" "#e0e0e0" "#e0e0e0" "#e0e0e0" "#e0e0e0" "#e0e0e0" 
        i         j 
"#e0e0e0" "#e0e0e0" 

Rgraphviz documentation built on Nov. 17, 2017, 9:53 a.m.