This package provides a (growing) collection of functions that analyze R code and identify particular idioms or characteristics. Some of these functions modify the code to produce more streamlined version. The package is motivated by compilation of R code and simplifying code ahead of compilation. However, the functionality may be useful generally for improving R code and diagnosing issues, and also in other contexts such as dynamic documents. We will continue to add functionality to analyze code for different purposes, e.g. memory management, opportunities for parallelism, data locality for parallel computations, ... Currently, there is functionality to: * finding global variables - like codetools::findGlobals but recognizing certain false positives, e.g., FUN in *apply() calls. * find unused parameters/arguments * find unused variables/assignments * identify constant parameters (i.e. unchanged in the function's body) * detect vector concatenation in loops * identify & remove dead code (after a call to return()) * remove dead if/else code blocks (i.e. where we are certain the condition is TRUE or FALSE) * identify parallel for loops.
Package details |
|
---|---|
Author | Duncan Temple Lang, Nick Ulle, Clark Fitzgerald, Matt Espe |
Maintainer | Duncan Temple Lang <duncan@r-project.org> |
License | BSD_3_clause + file LICENSE |
Version | 0.7-0 |
Package repository | View on GitHub |
Installation |
Install the latest version of this package by entering the following in R:
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.