Rclean-package: Rclean: A Tool for Writing Cleaner, More Transparent Code

Rclean-packageR Documentation

Rclean: A Tool for Writing Cleaner, More Transparent Code

Description

The Rclean package provides a set of functions to isolate the essential parts of a script that produces a chosen result, such as an object, table and/or figure.

Author(s)

Matthew K. Lau matthewklau@fas.harvard.edu

Examples

## Define the path for your script
script <- system.file(
        "example", 
        "simple_script.R", 
        package = "Rclean")
## Get a list of the variables in your script
get_vars(script)
## Take a look at the relationships in your script
code_graph(script)
## Pick a result and isolate the code
clean(script, "tab.15")
## You can also select multiple results at the same time!
my.vars <- c("tab.12", "tab.15")
clean(script, my.vars)

ropensci/Rclean documentation built on Dec. 8, 2022, 7:31 a.m.