This is a simple function for writing code to disk.
write.code(x, file = NULL)
Script object to write.
Path to where you want to write. Default writes to clipboard.
The script is written to disk, line by line.
# 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 DataCamp Workspace