cnPlot: Plot Network

cnPlot-methodR Documentation

Plot Network

Description

Draws the graph structure of catNetwork object or some diagnostic plots associated with a catNetworkEvaluate

Usage

cnPlot(object, file=NULL)

Arguments

object

catNetwork or catNetworkEvaluate object

file

a file name

Details

First we consider the case when object is a catNetwork. There are two visualization options implemented - one using 'igraph' and the other 'Graphviz'. The usage of these two alternatives is controlled by two environment variables - the logical one R_CATNET_USE_IGRAPH and the character one R_DOTVIEWER, correspondingly. If igraph is installed and R_CATNET_USE_IGRAPH is set to TRUE, the function constructs an igraph compatible object corresponding to the object and plot it.

If igraph is not found, the function generates a dot-file with name file.dot, if file is specified, or unknown.dot otherwise. Furthermore, provided that Graphviz library is found and R_DOTVIEWER points to the dot-file executable, the created earlier dot-file will be compiled to pdf or postscript, if object is a list. Finally, if the system has pdf or postscript rendering capabilities and R_PDFVIEWER variable shows the path to the pdf-rendering application, the resulting pdf-file will be shown.

In case object is of class catNetworkEvaluate, then the function draws six relevant plots: likelihood vs. complexity, Hamming (hamm) and exponential Hamming (hammexp) distances, Markov neighbor distance (FP plus FN), and the false positive (fp) and false negative (fn) edges vs. complexity.

Value

A R-plot or dot-file or pdf-file.

Author(s)

N. Balov

See Also

cnDot, catNetworkEvaluate-class, cnCompare

Examples

  ## Set R_CATNET_USE_IGRAPH to TRUE if you want to use 'igraph'
  #Sys.setenv(R_CATNET_USE_IGRAPH=FALSE)
  #cnet <- cnRandomCatnet(numnodes=10, maxParents=3, numCategories=2)
  #cnPlot(object=cnet)

catnet documentation built on Nov. 10, 2022, 5:08 p.m.