toFile               package:Rgraphviz               R Documentation

_R_e_n_d_e_r _a _g_r_a_p_h _i_n _a _f_i_l_e _w_i_t_h _g_i_v_e_n _f_o_r_m_a_t

_D_e_s_c_r_i_p_t_i_o_n:

     Render a graph in a file with given format

_U_s_a_g_e:

     toFile(graph,
               layoutType=c("dot","neato","twopi","circo","fdp"),
               filename,
               fileType=c("canon", "dot", "xdot", "dia", "fig",
                          "gd", "gd2", "gif", "hpgl", "imap", "cmapx",
                          "ismap", "mif", "mp", "pcl", "pic",
                          "plain", "plain-ext", "png", "ps", "ps2",
                          "svg", "svgz", "vrml", "vtx", "wbmp"))

_A_r_g_u_m_e_n_t_s:

   graph: an instance of the 'Ragraph' class

layoutType: which layout algorithm to use

filename: output file name

fileType: output file type

_D_e_t_a_i_l_s:

     This function takes a given 'Ragraph', does the chosen layout,
     then  renders the output to an external file.  Users could view
     the output file with corresponding viewer.

_V_a_l_u_e:

     'toFile' returns NULL after writing to a file.

_A_u_t_h_o_r(_s):

     Li Long <li.long@isb-sib.ch>

_R_e_f_e_r_e_n_c_e_s:

     Rgraphviz by E. Ganssner, S. North, www.graphviz.org

_E_x_a_m_p_l_e_s:

     library("graph")
     library("Rgraphviz")

     g1_gz <- gzfile(system.file("GXL/graphExample-01.gxl.gz",package="graph"), open="rb")
     g1 <- fromGXL(g1_gz)
     ag <- agopen(g1, name="test")

     toFile(ag, layoutType="dot", filename="g1_dot.svg", fileType="svg")
     toFile(ag, layoutType="neato", filename="g1_neato.ps", fileType="ps")
     toFile(ag, layoutType="twopi", filename="g1_twopi.svg", fileType="svg")
     toFile(ag, layoutType="circo", filename="g1_circo.png", fileType="png")

