checkUsage             package:codetools             R Documentation

_C_h_e_c_k _R _C_o_d_e _f_o_r _P_o_s_s_i_b_l_e _P_r_o_b_l_e_m_s

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

     Check R code for possible problems.

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

     checkUsage(fun, name = "<anonymous>", report = cat, all = FALSE, 
                suppressLocal = FALSE, suppressParamAssigns = !all,
                suppressParamUnused = !all, suppressFundefMismatch = FALSE,
                suppressLocalUnused = FALSE, suppressNoLocalFun = !all,
                skipWith = FALSE, suppressUndefined = dfltSuppressUndefined) 
     checkUsageEnv(env, ...) 
     checkUsagePackage(pack, ...) 

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

     fun: closure.

    name: character; name of closure.

     env: environment containing closures to check.

    pack: character naming package to check.

     ...: options to be passed to 'checkUsage'.

  report: function to use to report possible problems.

     all: logical; report all possible problems if TRUE.

suppressLocal: suppress all local variable warnings.

suppressParamAssigns: suppress warnings about assignments to formal
          parameters.

suppressParamUnused: suppress warnings about unused formal parameters.

suppressFundefMismatch: suppress warnings about multiple local function
          definitions with different formal argument lists

suppressLocalUnused: suppress warnings about unused local variables

suppressNoLocalFun: suppress warnings about using local variables as
          functions with no apparent local function definition

skipWith: logical; if true, do no examine code portion of 'with'
          expressions.

suppressUndefined: suppress warnings about undefined global functions
          and variables.

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

     'checkUsage' checks a single R closure.  Options control which
     possible problems to report.  The default settings are moderately
     verbose.  A first pass might use 'suppressLocal=TRUE' to suppress
     all information related to local variable usage. The 'suppressXYZ'
     values can either be scalar logicals or character vectors; then
     they are character vectors they only suppress problem reports for
     the variables with names in the vector.

     'checkUsageEnv' and 'checkUsagePackage' are convenience functions
     that apply 'checkUsage' to all closures in an environment or a
     package.  'checkUsagePackage' requires that the package be loaded.
      If the package has a name space then the internal name space
     frame is checked.

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

     Luke Tierney

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

     checkUsage(checkUsage)
     checkUsagePackage("codetools",all=TRUE)
     ## Not run: checkUsagePackage("base",suppressLocal=TRUE)

