write_lines {readr} | R Documentation |
write_lines
takes a character vector, appending a new line
after entry. write_file
takes a single string, or a raw vector,
and writes it exactly as is.
write_lines(x, path, na = "NA", append = FALSE) write_file(x, path, append = FALSE)
x |
A data frame to write to disk |
path |
Path to write to. |
na |
String used for missing values. Defaults to NA. Missing values
will never be quoted; strings with the same value as |
append |
If |
The input x
, invisibly.
tmp <- tempfile() write_lines(rownames(mtcars), tmp) read_lines(tmp) read_file(tmp) # note trailing \n write_lines(airquality$Ozone, tmp, na = "-1") read_lines(tmp)