This Reporter takes a package and uncovers the structure from its other functions, determining useful information such as which function is most central to the package. Combined with testing information it can be used as a powerful tool to plan testing efforts.

R6 classes are supported, with methods treated as functions by the Reporter. R6 methods will be named like <classname>$<methodtype>$<methodname> , e.g., FunctionReporter$private_methods$extract_nodes. Note that the class name used will be the name of the generator object in the package's namespace, and not the classname attribute of the class, which is not required to be defined or to be the same as the generator object name.

FunctionReporter

Format

An object of class R6ClassGenerator of length 24.

Public Methods

set_package(pkg_name, pkg_path)

  • Set properties of this reporter. If pkg_name overrides a previously-set package name, any cached data will be removed.

  • Args:

    • pkg_name: String with the name of the package.

    • pkg_path: Optional directory path to source code of the package. It is used for calculating test coverage. It can be an absolute or relative path.

Known Limitations

  • Using non-standard evaluation to refer to things (e.g, dataframe column names) that have the same name as a function will trick FunctionReporter into thinking the function was called. This can be avoided if you don't use reuse function names for other purposes.

  • Functions stored as list items and not assigned to the package namespace will be invisible to FunctionReporter.

  • Calls to methods of instantiated R6 or reference objects will not be recognized. We don't have a reliable way of identifying instantiated objects, or identifying their class.

  • Reference class methods are not yet supported. They will not be idenified as nodes by FunctionReporter.

See also