patchCode              package:R.utils              R Documentation

_P_a_t_c_h_e_s _i_n_s_t_a_l_l_e_d _a_n_d _l_o_a_d_e_d _p_a_c_k_a_g_e_s _a_n_d _m_o_r_e

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

     Patches installed and loaded packages and more.

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

     ## Default S3 method:
     patchCode(paths=NULL, recursive=TRUE, suppressWarnings=TRUE, knownExtensions=c("R", "r", "S", "s"), verbose=FALSE, ...)

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

   paths: The path to the directory (and subdirectories) which contains
          source code that will patch loaded packages. If 'NULL', the
          patch path is given by the option 'R_PATCHES', If the latter
          is not set, the system environment with the same name is
          used. If neither is given, then '~/R-patches/' is used.

recursive: If 'TRUE', source code in subdirectories will also get
          loaded. 

suppressWarnings: If 'TRUE', 'warning's will be suppressed, otherwise
          not.

knownExtensions: A 'character' 'vector' of filename extensions used to
          identify source code files. All other files are ignored.

 verbose: If 'TRUE', extra information is printed while patching,
          otherwise not.

     ...: Not used.

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

     The method will look for source code files (recursively or not)
     that match known filename extensions. Each found source code file
     is then 'source'()d.

     If the search is recursive, subdirectories are entered if and only
     if either (1) the name of the subdirectory is the same as a
     _loaded_ (and installed) package, or (2) if there is no installed
     package with that name. The latter allows common code to be
     organized in directories although it is still not assigned to
     packages.

     Each of the directories given by argument 'paths' will be
     processed one by one. This makes it possible to have more than one
     file tree containing patches.

     To set an options, see 'options'(). To set a system environment,
     see 'Sys.putenv'(). The character ';' is interpreted as a
     separator. Due to incompatibility with Windows pathnames, ':' is
     _not_ a valid separator.

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

     Returns (invisibly) the number of files sourced.

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

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

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

     'source'(). 'library'(). 'relibrary'().

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

     ## Not run: 
        # Patch all source code files in the current directory
        patchCode(".")

        # Patch all source code files in R_PATCHES
        options("R_PATCHES"="~/R-patches/")
        # alternatively, Sys.putenv("R_PATCHES"="~/R-patches/")
        patchCode()
      ## End(Not run)

