writeperl              package:pinktoe              R Documentation

_W_r_i_t_e_s _t_h_e _p_e_r_l _f_i_l_e(_s) _f_o_r _p_i_n_k_t_o_e

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

     A perl file needs to be written that works out whether a tick box
     has been checked and then calls either code to deal with a leaf or
     an HTML file for another decision to be made.

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

     writeperl(childleftrow, childrightrow, treeobj, perlname, edmlabel, htmldir, edmix, stateprintfn, requirelib)

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

childleftrow: The "left" hand row number possibility stemming from this
          node.

childrightrow: The "right" hand row number possibility stemming from
          this node.

 treeobj: The 'rpart' or 'tree' object that this whole process is using

perlname: The name of the perl file to construct (returned earlier from
          'writehtml'

edmlabel: The variable name (from the 'var' field of the original tree)
          for this HTML file/question. 

 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).

   edmix: A vector of the node numbers (row names of the $frame
          component of the tree)

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.

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

     The HTML file that preceeds the construction of the currently
     described perl file  describes a decision with two possible
     courses of action. These are coded in the 'childleftrow' and
     'childrightrow' arguments. Perl code is written to work out
     whether the checkbox in the HTML code was ticked or note and then
     execute the relevant next HTML file or leaf code.

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

     No value returned.

_N_o_t_e:

     Not intended for general user use

_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:

     'pinktoe'

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

     #
     #Not intended for general user use
     #

