clean: clean - Clean code.

View source: R/clean.R

cleanR Documentation

clean — Clean code.

Description

Reduce the size and complexity of a analytical script through algorithmic detection of the essential code needed to produce a set of results.

Usage

clean(script, vars, format = TRUE)

Arguments

script

File path to a script or a Script object from CodeDepends.

vars

The name of the variable(s) of interest.

format

LOGICAL: should the minimized code be re-formatted following common syntax style guides?

Value

A character vector containing a minimized script based on the given input variable or set of variables.

Author(s)

Matthew K. Lau

Examples

script <- system.file(
        "example", 
        "simple_script.R", 
        package = "Rclean")
clean(script)
clean(script, "mat")
clean(script, "tab.12")
clean(script, c("mat", "tab.12", "out"))

MKLau/Rclean documentation built on Dec. 6, 2022, 7:18 p.m.