dochelp               package:mvbutils               R Documentation

_D_o_c_u_m_e_n_t_a_t_i_o_n

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

     'dochelp(topic)' will be invoked by the replacement 'help' if
     conventional 'help' fails to find documentation for topic 'topic'.
     If 'topic' has a 'doc' attribute, the latter will be formatted and
     displayed by 'file.show'. 'dochelp' is not usually called
     directly.

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

     # Not usually called directly
     # If it is, then normal usage is: dochelp( topic)
     dochelp( topic, doc)

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

   topic: (character) name of the object to look for help on.

     doc: (character or list)- normally not set, but deduced by default
          from 'topic'; see DETAILS.

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

     'dochelp' will only be called if the original 'help' call was a
     simple 'help(topic=X,...)' form, with X not a call and with no
     'try.all.packages' or 'type' or 'lib.loc' arguments (the other
     'help' options are OK).

     The 'doc' argument defaults to the 'doc' attribute of
     'get("topic")'. The only reason to supply a non-default argument
     would be to use 'dochelp' as a pager; this might have some value,
     since 'dochelp' does reformat character vectors to fit nicely in
     the system pager window, one paragraph per element, using
     'strwrap'. Elements starting with a "%" symbol are not displayed.

     To work with 'dochelp', a 'doc' attribute should be either:

        *  a character vector, of length >=1. New elements get line
           breaks in the pager. Or:

        *  a length-one list, containing the name of another object
           with a 'doc' attribute. 'dochelp' will then use the 'doc'
           attribute of that object instead. This referencing can be
           iterated.

     If the documentation is very informal, start it with a blank line
     to prevent 'find.documented( Rdformat=TRUE)' from finding it.

     The file will be re-formatted to fit the pager; each paragraph
     should be a single element in the character vector. Elements
     starting with a % will be dropped (but may still be useful for
     'doc2Rd').

     'flatdoc' offers an easy way to incorporate plain-text
     (flat-format) documentation- formal or informal- in the same text
     file as a function definition, allowing easy maintenance.

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

     Mark Bravington

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

     'flatdoc', 'doc2Rd', 'find.documented', 'strwrap'

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

     myfun <- structure( function() 1,
      doc="Here is some informal documentation for myfun\n")
     dochelp( "myfun")
     help( "myfun") # calls dochelp

