
Last chance! 50% off unlimited learning
Sale ends in
fileEdit(..., title = files, editor = getOption("fileEditor"), file.encoding = "",
template = NULL, replace = FALSE, wait = FALSE)
""
or native.enc
,
the files are considered as being already in the right encoding.NULL
, an empty file is created. This argument is recycled for all
files to edit.template
is not null.TRUE
if it was able to edit the files or
FALSE
otherwise, invisibly. Encountered errors are reported as warnings.systemFile
, file.path
,
file.exists
, file.edit
## Create a template file in the tempdir...
tpl <- tempfile("template", fileext = ".txt")
cat("Example template file\nto be used with fileEdit()\n", file = tpl)
## ... and edit a new file, starting from that template:
newf <- tempfile("test", fileext = ".txt")
fileEdit(newf, template = tpl, wait = TRUE)
## Make sure the content ends with \n, and read it
cat("\n", file = newf, append = TRUE)
cat("Your file contains:\n")
readLines(newf)
## Eliminate both the file and template
unlink(newf)
unlink(tpl)
Run the code above in your browser using DataLab