Learn R Programming

RedeR (version 1.20.0)

addGraph: Add graphs to RedeR application.

Description

Method to wrap R graphs into RedeR objects and send it to RedeR app.

Usage

addGraph(obj, g, ...)

Arguments

obj
Object of RedPort Class.
g
An igraph object.
...
Additional arguments passed to RedeR application.

Value

Submits R graphs to RedeR app.

Attributes passed by the igraph object

Graph attributes
bgColor
Sets the background color of the app panel .
zoom
Sets the zoom scale for the app panel (range: 0.0 to 100.0) (Default=100) .
gscale
Expansion factor of the graph area related to the app panel (range: 0.0 to 100.0) (Default=100) (PS. alternative entry to the 'gscale' argument above).
coordX
Sets the graph x center; x between 0 and 100 sets to visible area (PS. alternative entry to the 'gcoord' argument above).
coordY
Sets the graph y center; y between 0 and 100 sets to visible area (PS. alternative entry to the 'gcoord' argument above).
loadEdges
Logical value, whether to send edges to RedeR app (Default=TRUE) (PS. alternative entry to the 'loadEdges' argument above).
isNest
Logical value, whether to nest all nodes into a new container (Default=FALSE) (PS. alternative entry to the 'nest' argument above).
isAnchor
If isNest=TRUE, this logical value sets whether to anchor the container in dynamic layouts (Default=FALSE).
isAssign
If isNest=TRUE, this logical value sets whether to assign the container name to the nested nodes (Default=FALSE).
nestColor
If isNest=TRUE, this attribute sets the 'color' of the new container .
nestAlias
If isNest=TRUE, this attribute sets the label of the new container .
nestFontSize
If isNest=TRUE, this attribute sets the size of the container label (Default=12). .
nestFontColor
If isNest=TRUE, this attribute sets the 'color' of the container label .
nestFontX
If isNest=TRUE, this attribute sets the x position of the label related to the container (Default=-8) .
nestFontY
If isNest=TRUE, this attribute sets the y position of the label related to the container (Default=-8) .
nestShape
If isNest=TRUE, this attribute sets the shape of the container, options: <'ellipse'> and <'rounded_rectangle'> (Default= ELLIPSE).
nestSize
If isNest=TRUE, this attribute sets the size of the container (Default=NULL) .
nestLineWidth
If isNest=TRUE, this attribute sets the line width of the container, options: >= 0 (Default=1.0) .
nestLineColor
If isNest=TRUE, this attribute sets the line color of the container .
nestImage
If isNest=TRUE, sets the status of the container on the screen: <'plain'>, <'transparent'>, or <'hide'> (Default= plain).
nestLineType
If isNest=TRUE, this attribute sets the line type of the container: <'solid'>, <'dotted'>, <'dotted_short'>, <'long_dash'> (Default='SOLID').
Vertex attributes
name
Node attribute 'name' .
nodeAlias
Node attribute 'alias' .
nodeBend
Node attribute 'bend', options: 0-100% (Default=50) .
coordX
Node attribute 'x coord' (Default=random coord) .
coordY
Node attribute 'y coord'(Default=random coord) .
nodeSize
Node attribute 'size', options: > 0 (Default=20) .
nodeShape
Node attribute 'shape', options: 'ELLIPSE', 'RECTANGLE', 'ROUNDED_RECTANGLE', 'TRIANGLE', 'DIAMOND' (Default= ELLIPSE) .
nodeColor
Node attribute 'color', e.g. "#ff0000" for red .
nodeWeight
Node attribute 'weight', options: >= 0 (Default=0) .
nodeLineWidth
Node attribute 'line width', options: >= 0 (Default=1) .
nodeLineColor
Node attribute 'line color', e.g. "#ff0000" for red .
nodeFontSize
Node attribute 'font size', options: >= 0 (Default=12) .
nodeFontColor
Node attribute 'font color', e.g. "#ff0000" for red .
Edge attributes
arrowDirection
Edge attribute 'arrow direction', used to set mixed associations in undirected graphs. Options: 0 (A-B), 1 (A-> B), -1 (A-| B), 2 (A <-B), -2 (A |-B), 3 (A <-> B), -3 (A |-| B), 4 (A |-> B) and -4 (A <-| B) (Default=0) .
arrowType
Edge attribute 'arrow type', used to set the association mode in directed graphs. Options: -1, 0 and 1 (Default=1) .
edgeWeight
Edge attribute 'weight', options: >= 0 (Default=0.0) .
edgeWidth
Edge attribute 'width', options: >=0 (Default=1.0) .
edgeColor
Edge attribute 'color', e.g. "#ff0000" for red .
edgeType
Edge attribute 'color', options: 'SOLID', 'DOTTED, 'DOTTED_SHORT', 'LONG_DASH' (Default='SOLID').
arrowLength
Edge arrow attribute 'length', options: > 0 (Default=10) .
arrowAngle
Edge arrow attribute 'angle', options: 0-90 (Default=45) .
linkType
Set assignment type either between nodes and containers or containers and containers. Options: 'nested' and 'notnested' (Default='nested') .

Details

Additional arguments:
layout
Vertex coordinates (graph layout). Accepts matrix with 2 cols (i.e. x and y coords) .
gscale
Expansion factor of the graph area related to the app panel area (default = 75) .
zoom
Sets the zoom scale for the app panel (range: 0.0 to 100.0; default = 100.0) .
gcoord
Sets the graph x,y center. Coords between 0 and 100 are set to the visible area of the app panel (default = c(50,50)) .
isNest
Logical value, whether to nest all nodes into a new container (default = FALSE). See additional args in nestNodes
isAnchor
If isNest=TRUE, this logical value sets whether to anchor the container in dynamic layouts (default = TRUE).

isAssign
If isNest=TRUE, this logical value sets whether to assign the container name to the nested nodes (default = FALSE).

loadEdges
Logical value, whether to send edges to RedeR app (default = TRUE).
theme
Some pre-defined nest attributes. Options: 'tm0','tm1','tm2','tm3','tm4','tm5','tm6' . Alternatively, it can be a list with customized attributes.

ntransform
Logical value, whether to transform nodes in containers (default = FALSE).

parent
ID of a container already available in the app . Nodes from g will be nested to this container.

See Also

getGraph addLegend nesthc nestNodes mergeOutEdges relax selectNodes att

Examples

Run this code

rdp <- RedPort('MyPort')

## Not run: 
# 
# calld(rdp)
# 
# ###
# 
# g1 <- graph.empty(n=10, directed=FALSE)
# addGraph( rdp, g1, layout.random(g1) )
# 
# resetd(rdp)
# 
# ###
# 
# g2 <- graph.lattice(c(5,5,5))
# addGraph( rdp, g2, layout.kamada.kawai(g2) )
# 
# resetd(rdp)
# 
# ###
# 
# g <- barabasi.game(10)
# V(g)$name<-letters[1:10]
# V(g)$nodeSize<-c(100,rep(30,9))
# addGraph( rdp,  g, ntransform=TRUE )
# 
# sg <- barabasi.game(3)
# addGraph( rdp, sg, parent="a" )
# 
# resetd(rdp)
# 
# ###...to check loading an interactome!
# 
# data(hs.inter)
# system.time( addGraph(rdp, hs.inter, layout=NULL) )
# 
# 
# ## End(Not run)

Run the code above in your browser using DataLab