Learn R Programming

catnet (version 1.00.0)

cnDot-method: Network Description File

Description

The function generates a dot-file, the native storage format for Graphviz software package, that describes the graph structure of a catNetwork object.

Usage

cnDot(object, file="")

Arguments

object
a catNetwork, a list of catNetworks or a parent matrix
file
a character, an optional output file name

Value

  • A character or dot-file

Details

The function generates a dot-text file. In order to view the corresponding graph, the user needs a dot-file converter and pdf/postscript viewer. Two environment variables have to be set also: R_DOTVIEWER and R_PDFVIEWER with the full path to the executable routines.

If Graphviz is installed and environment variable R_DOTVIEWER is set with the full path to the dot executable file (the routine that converts a dot-text file to a postscript or pdf), a pdf or postscript file is created depending whether object is a catNetwork or a list of catNetwork.

Next, if a pdf-viewer is available, the created postscript or pdf file is shown.

If file is not specified, then the function just prints out the resulting string which otherwise would be written into a file.

See Also

catnet-package, cnPlot

Examples

Run this code
cnet <- cnRandomCatnet(numnodes=10, maxParents=3, numCategories=2)
  cnDot(object=cnet, file="cnet")

Run the code above in your browser using DataLab