Learn R Programming

Rclean (version 1.0.0)

write.code: write.code --- Write code to disk. OUTPUT = Writes out code from an object to a specified file.

Description

This is a simple function for writing code to disk.

Usage

write.code(x, file = NULL)

Arguments

x

Script object to write.

file

Path to where you want to write. Default writes to clipboard.

Value

The script is written to disk, line by line.

Examples

Run this code
# NOT RUN {
 data(prov_json)
 options(prov.json = prov_json)
 some.code <- c("x <- 1", "y <- x + 1")
 write.code(some.code) # copies to clipboard by default
# }

Run the code above in your browser using DataLab