printProfileCallGraph       package:proftools       R Documentation

_P_r_i_n_t _C_a_l_l _G_r_a_p_h _f_o_r _R_p_r_o_f _P_r_o_f_i_l_e _D_a_t_a

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

     Prints a representation of the call graph for profile data
     produced by 'Rprof'.  Output can be directed to a connection or a
     file.

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

     printProfileCallGraph(pd, file = stdout(), percent = TRUE)

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

      pd: profile data as returned by 'readProfileData'.

    file: a connection or the name of the file where the profile graph
          will be written. 

 percent: logical; if true use percent of total time; otherwise use
          time in seconds 

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

     'printProfileCallGraph' produces a printed representation of the
     call graph for profile data produced by 'Rprof'.  The
     representation is analogous to the call graph produced by 'gprof'
     with a few minor changes.  eventually more complete documentation
     of the format will be provided here; for now, reading the 'gprof'
     manual section on the call graph should help understanding this
     output.  The output is similar enough to gprof output for the
     'cgprof' script to be able to produce a visual representation of
     the call graph via Graphviz.

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

     Used for side effect.

_N_o_t_e:

     Because of lazy evaluation, nested calls like 'f(g(x))' appear in
     the profile graph as 'f' or one of its callees calling 'g'.

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

     Luke Tierney

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

     User manual for 'gprof', the GNU profiler.

     'cgprof': <URL: http://mvertes.free.fr/>

     Graphviz: <URL: http://www.research.att.com/sw/tools/graphviz/>

_S_e_e _A_l_s_o:

     'Rprof', 'summaryRprof', 'flatProfile', 'readProfileData',
     'plotProfileCallGraph', 'profileCallGraph2Dot'

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

     ## Not run: 
          ## Rprof() is not available on all platforms
          Rprof(tmp <- tempfile())
          example(glm)
          Rprof()
          printProfileCallGraph(readProfileData(tmp))
          unlink(tmp)

          ## If you have graphviz and cgprof installed on a UNIX-like system
          ## then in R do:

          Rprof(tmp <- tempfile())
          example(glm)
          Rprof()
          printProfileCallGraph(readProfileData(tmp), "foo.graph")

          ## and then in a shell do (to use the interactive dotty):

          cgprof -TX foo.graph

          ## or (to create a postscript version and view with gv):

          cgprof -Tps foo.graph > foo.ps
          gv foo.ps
       ## End(Not run)

