Last data update: 2014.03.03

R: Class "AgNode": A class to describe a node for a Ragraph...
AgNode-classR Documentation

Class "AgNode": A class to describe a node for a Ragraph object

Description

This class is used to represent nodes for the Ragraph class. One can retrieve various pieces of information as well as draw them.

Objects from the Class

Objects can be created by calls of the form new("AgNode", ...).

Slots

center:

Object of class "xyPoint": The center point of the node

name:

Object of class "character": The name of the node, used to reference it

txtLabel:

Object of class "AgTextLabel": Label for this edge

height:

Object of class "integer": Height of the node in points

rWidth:

Object of class "integer": The right half of the node in points.

lWidth:

Object of class "integer": The left half of the node in points.

color:

Object of class "character": The drawing color of the node.

fillcolor:

Object of class "character": The color to fill in the node with.

shape:

Object of class "character": The shape of the node.

style:

Object of class "character": The style of the node.

Methods

color

signature(object = "AgNode"): Retrieves the drawing color for the node.

fillcolor

signature(object = "AgNode"): Retrieves the color to fill in the node image with.

getNodeCenter

signature(object = "AgNode"): Returns the center point of the node.

getNodeXY

signature(object = "AgNode"): Returns the center as a two element list, with the first element containing the 'x' value and the second element containing the 'y' value.

getNodeHeight

signature(object = "AgNode"): Returns the height of the node.

getNodeLW

signature(object = "AgNode"): Returns the left width of the node.

getNodeRW

signature(object = "AgNode"): Returns the right width of the node.

name

signature(object = "AgNode"): Retrieves the name of the node.

shape

signature(object = "AgNode"): Returns the shape of the node.

style

signature(object = "AgNode"): Returns the style of the node.

txtLabel

signature(object = "AgNode"): Retrieves the node label.

Author(s)

Jeff Gentry

See Also

Ragraph

Examples

V <- letters[1:10]
M <- 1:4
g1 <- randomGraph(V, M, .2)
z <- agopen(g1,name="foo")
x <- AgNode(z) ## list of AgNode objects
vv <- x[[1]]

## The methods in use
color(vv)
fillcolor(vv)
getNodeCenter(vv)
getNodeXY(vv)
getNodeHeight(vv)
getNodeLW(vv)
getNodeRW(vv)
name(vv)
shape(vv)
style(vv)
txtLabel(vv)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Rgraphviz)
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, 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

Loading required package: grid
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Rgraphviz/AgNode-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: AgNode-class
> ### Title: Class "AgNode": A class to describe a node for a Ragraph object
> ### Aliases: AgNode-class AgNode AgNode<- color fillcolor name shape
> ###   getNodeRW getNodeLW getNodeCenter getRadiusDiv getNodeHeight style
> ###   style,AgNode-method color,AgNode-method fillcolor,AgNode-method
> ###   getNodeXY,AgNode-method getNodeCenter,AgNode-method
> ###   getNodeHeight,AgNode-method getNodeLW,AgNode-method
> ###   getNodeRW,AgNode-method name,AgNode-method shape,AgNode-method
> ###   txtLabel,AgNode-method drawAgNode
> ### Keywords: classes
> 
> ### ** Examples
> 
> V <- letters[1:10]
> M <- 1:4
> g1 <- randomGraph(V, M, .2)
> z <- agopen(g1,name="foo")
> x <- AgNode(z) ## list of AgNode objects
> vv <- x[[1]]
> 
> ## The methods in use
> color(vv)
[1] "black"
> fillcolor(vv)
[1] "transparent"
> getNodeCenter(vv)
x: 70, y: 440
> getNodeXY(vv)
$x
[1] 70

$y
[1] 440

> getNodeHeight(vv)
[1] 54
> getNodeLW(vv)
[1] 27
> getNodeRW(vv)
[1] 27
> name(vv)
[1] "a"
> shape(vv)
[1] "circle"
> style(vv)
[1] ""
> txtLabel(vv)
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

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>