Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stri_write_lines

Write Text Lines to a Text File


Description

Writes a text file is such a way that each element of a given character vector becomes a separate text line.

Usage

stri_write_lines(
  str,
  con,
  encoding = "UTF-8",
  sep = ifelse(.Platform$OS.type == "windows", "\r\n", "\n"),
  fname = con
)

Arguments

str

character vector with data to write

con

name of the output file or a connection object (opened in the binary mode)

encoding

output encoding, NULL or '' for the current default one

sep

newline separator

fname

deprecated alias of con

Details

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.

Value

This function returns nothing noteworthy.

See Also

Other files: stri_read_lines(), stri_read_raw()


stringi

Character String Processing Facilities

v1.6.1
file LICENSE
Authors
Marek Gagolewski [aut, cre, cph] (<https://orcid.org/0000-0003-0637-6028>), Bartek Tartanus [ctb], and others (stringi source code); IBM, Unicode, Inc. and others (ICU4C source code, Unicode Character Database)
Initial release
2021-05-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.