keep: keep - Copy code to clipboard or write a specified file....

Description Usage Arguments Value Author(s) Examples

View source: R/keep.R

Description

Simplifies writing and copying code to clipboard by removing the need to separately create and specify a file connection or to send code to the clipboard.

Usage

1
keep(x, file = NULL)

Arguments

x

Line(s) of code.

file

Path to write code. If not specified, code is copied to the clipboard.

Value

The code is copied to the clipboard or written to disk.

Author(s)

Matthew K. Lau

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
script <- system.file(
        "example", 
        "simple_script.R", 
        package = "Rclean")
clean.code <- clean(script, "tab.15")
## Copies code to your clipboard
keep(clean.code)
## Saves code to your disk
keep(clean.code, file = "clean_code.R")

## End(Not run)

MKLau/Rclean documentation built on Feb. 18, 2020, 1:08 p.m.