powered by
The text is converted to UTF-8 encoding before writing.
write_lines(text, path, eol = "\n")
The UTF-8 encoded input text (invisibly).
A character vector to write
A character string giving the file path to write to.
The end of line characters to use between lines.
The files are opened in binary mode, so they always use exactly the string given in eol as the line separator.
eol
To write a file with windows line endings use write_lines(eol = "\r\n")
write_lines(eol = "\r\n")
tf <- tempfile() write_lines(rownames(mtcars), tf) # Write with Windows style line endings write_lines(rownames(mtcars), tf, eol = "\r\n") unlink(tf)
Run the code above in your browser using DataLab