duncantl/CodeAnalysis: Tools for Static Analysis of R code

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 * 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

Getting started

Package details

AuthorDuncan Temple Lang, Nick Ulle, Clark Fitzgerald, Matt Espe
MaintainerDuncan Temple Lang <[email protected]>
LicenseBSD_3_clause + file LICENSE
Package repositoryView on GitHub
Installation Install the latest version of this package by entering the following in R:
duncantl/CodeAnalysis documentation built on July 19, 2019, 7:13 p.m.