pinktoe               package:pinktoe               R Documentation

_P_i_n_k_t_o_e: _c_o_n_v_e_r_t _S _t_r_e_e_s _t_o _w_e_b _f_i_l_e_s _f_o_r _i_n_t_e_r_a_c_t_i_v_e _t_r_a_v_e_r_s_a_l.

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

     Pinktoe converts a S tree object to a set of HTML and perl files
     that can be, once uploaded to a perl-aware web server,
     interactively traversed by a user with a web browser. This is
     useful for large trees or trees where the variables require
     description by verbose text.

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

     pinktoe(treeobj, textfn, tittext, treeid = "",
         cgibindir = paste("/~magpn/cgi-bin/", treeid, "/", sep = ""),
         htmldir = paste("/home/magpn/public_html/Research/Politics/TREE/",
         treeid, "/", sep = ""), localdir = "Tree/", stateprintfn = partyprint,
         requirelib = "../party.lib", commonhtml)

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

 treeobj: An object of class rpart (or tree in S) 

  textfn: A user supplied function that prints out text to a file in
          response to a variable name.

 tittext: A user supplied function that prints out title text to a file
          in response to a variable name 

  treeid: This is a character string which is appended to both
          'cgibindir' and 'htmldir'. This can be useful when you are
          building web pages for a collection of trees and store
          different trees in separate directories. 

cgibindir: A character string containing the directory where the perl
          files generated by pinktoe (with the extension '.pl') will be
          stored.   (This should be the directory part of the URL of
          the cgi-bin  directory). 

 htmldir: A character string containing the directory where the HTML
          files generated by pinktoe (with the extension '.htm') will
          be stored.  (This should be a pathname understood and able to
          be found by perl). 

localdir: A local location to store both the HTML and perl files
          immediately after they are generated 

stateprintfn: A user-supplied function that decides what to do when
          supplied with the 'yval' reached at the leaf of a tree. Some 
          text can be output, or maybe a perl function call.  

requirelib: A library of perl functions that can be called by, e.g.
          'stateprintfn'. The library that this refers to should reside
          in the 'cgibin' directory. If no function calls are planned
          then it doesn't matter what argument is supplied.

commonhtml: A user-supplied function that prints out some HTML code.
          This is appended to every HTML web page.

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

     See the example below for usage. See <URL:
     http://www.stats.bris.ac.uk/~magpn/Research/Pinktoe/Welcome.html>
     for a full description

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

     No value is produced.

_N_o_t_e:

     This is version 2, an earlier version didn't work well with R

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

     Guy P Nason

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

     <URL:
     http://www.stats.bris.ac.uk/~magpn/Research/Pinktoe/Welcome.html>

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

     'PT'

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

     #
     # Attach rpart library
     #
     library("rpart")
     data("mpincdf99")
     #
     # Create a tree (rpart object)
     #
     z.edm <- makeEDMtree()
     #
     # Plot the tree to see its basic structure.
     #
     plot(z.edm)
     text(z.edm)
     #
     # Now use pinktoe to generate a set of htm and pl files that can be used
     # by a CGI-enabled web server to traverse the tree.
     #
     data("edmbigtext")
     #
     # Next code requires "sfsmisc" library. This is not installed by default
     # in R distributions so you'll have to get it yourself. We make sure
     # that the next code doesn't run because R CMD check can't install packages (I think)
     #
     ## Not run: 
     pinktoe(z.edm, edm.text, partytittext, treeid="", localdir="./",
         cgibindir="/~magpn/cgi-bin/TEST/",  
         htmldir="/home/magpn/public_html/TEST/", stateprintfn=partyprint, 
         requirelib="../party.lib", 
         commonhtml=partycommonhtml)  
     ## End(Not run)
     # Frame row number is  1 
     # Node number is  1 
     # Frame row number is  2 
     # Node number is  2 
     # Frame row number is  3 
     # Node number is  4 
     # Frame row number is  4 
     # Node number is  8 
     # Frame row number is  6 
     # Node number is  17 
     # Frame row number is  7 
     # Node number is  34 
     # Frame row number is  8 
     # Node number is  68 
     # Frame row number is  9 
     # Node number is  136 
     # Frame row number is  17 
     # Node number is  3 
     #
     # If you look in the current directory you'll find a load of perl and
     # HTML files created.
     #

