text_write: write text to file

Description Usage Arguments

View source: R/text_write.R

Description

A generic function to write text to file (or a connections) and accompanying methods that wrap writeLines to do so. In contrast to vanilla writeLines() text_write() (1) is a generic so methods, handling something else than character vectors, can be implemented (2) in contrast to writeLines()' default to transform to write text in the system locale text_write() will default to UTF-8 no matter the locale (3) furthermore this encoding can be changed to any encoding supported by iconv (see also inconvlist iconv)

Usage

1
2
3
4
text_write(string, file, sep = "\n", encoding = "UTF-8", ...)

## Default S3 method:
text_write(string, file, sep = "\n", encoding = "UTF-8", ...)

Arguments

string

text to be written

file

file name or file path or an connections object - passed through to writeLines()'s con argument

sep

character to separate lines (i.e. vector elements) from each other - passed through to writeLines()'s con argument

encoding

encoding in which to write text to disk

...

further arguments that might be passed to methods (not used at the moment)


stringb documentation built on Jan. 26, 2021, 1:07 a.m.

Related to text_write in stringb...