VComments              package:R.utils              R Documentation

_T_h_e _V_C_o_m_m_e_n_t_s _c_l_a_s_s

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

     Package:  R.utils 
      *Class VComments*

     'Object'
      '~~|'
      '~~+--''SmartComments'
      '~~~~~~~|'
      '~~~~~~~+--''VComments'

     *Directly known subclasses:*
      LComments

     public static class *VComments*
      extends _SmartComments_

     The VComments class.

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

     VComments(letter="V", verboseName="verbose", ...)

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

  letter: The smart letter.

verboseName: The name of the verbose object.

     ...: Not used.

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

     The 'v' in VComments stands for 'verbose', because of its
     relationship to the 'Verbose' class.

     Here is a list of VComments and the R code that replaces each of
     them by the compiler:

     *Constructors*

   #_V_0# [<args>] - NullVerbose(<args>)

   #_V_1# [<args>] - Verbose(<args>)

     *Controls*

   #_V=# [<variable>] - Sets the name of the <verbose> object. Default
        is 'verbose'.

   #_V^# <threshold> - setThreshold(<verbose>, <threshold>)

   #_V?# <expression> - if (isVisible(<verbose>)) { <expression> }

   #_V@# <level> - setDefaultLevel(<verbose>, <level>)

   #_V_m# <method> <args> - <method>(<verbose>, <args>)

     *Enters and exits*

   #_V+# [<message>] - enter(<verbose>, <message>)

   #_V-# [<message>] - exit(<verbose>, <message>)

   #_V!# [<message>] - pushState(<verbose>)
         on.exit(popState(<verbose>))
         If <message>, enter(<verbose>, <message>)

     *Simple output*

   #_V_n# <ignored> - newline(<verbose>)

   #_V_r# <ignored> - ruler(<verbose>)

   #_V_t# <ignored> - timestamp(<verbose>)

   #_V_w# [<title>] - warnings(<verbose>, <title>)

     *Output messages*

   #_V_c# [<message>] - cat(<verbose>, <message>)

   #_V_e# <expression> - eval(<verbose>, <expression>)

   #_V_h# <message> - header(<verbose>, <message>)

   #_V_p# <object> - print(<verbose>, <object>)

   #_V_s# <object> - summary(<verbose>, <object>)

   #_V_z# <object> - str(<verbose>, <object>)

_F_i_e_l_d_s _a_n_d _M_e_t_h_o_d_s:

     *Methods:*

         'convertComment'  Converts a verbose comment to R code.
         'reset'           Resets a VComments compiler.
         'validate'        Validates the compiled lines.

     *Methods inherited from SmartComments*:
      compile, convertComment, parse, reset, validate

     *Methods inherited from Object*:
      $, $<-, [[, [[<-, as.character, attach, attachLocally, clone,
     detach, equals, extend, finalize, getFields, getInstanciationTime,
     getStaticInstance, hasField, hashCode, ll, load, objectSize,
     print, save

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

     Henrik Bengtsson (<URL: http://www.braju.com/R/>)

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

     filename <- system.file("data-ex/exampleVComments.R", package="R.utils")
     lines <- readLines(filename)

     cat("Code before preprocessing:\n")
     displayCode(code=lines, pager="console")

     lines <- VComments$compile(lines)

     cat("Code after preprocessing:\n")
     displayCode(code=lines, pager="console")

