Writes a text file is such a way that each element of a given character vector becomes a separate text line.
stri_write_lines(
str,
con,
encoding = "UTF-8",
sep = ifelse(.Platform$OS.type == "windows", "\r\n", "\n"),
fname = con
)
character vector with data to write
name of the output file or a connection object (opened in the binary mode)
output encoding, NULL
or ''
for
the current default one
newline separator
deprecated alias of con
This function returns nothing noteworthy.
It is a substitute for the R writeLines
function,
with the ability to easily re-encode the output.
We suggest using the UTF-8 encoding for all text files: thus, it is the default one for the output.
Other files:
stri_read_lines()
,
stri_read_raw()