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)
text_write(string, file, sep = "\n", encoding = "UTF-8", ...)# S3 method for default
text_write(string, file, sep = "\n", encoding = "UTF-8", ...)
text to be written
file name or file path or an connections object - passed through to writeLines()'s con argument
character to separate lines (i.e. vector elements) from each other - passed through to writeLines()'s con argument
encoding in which to write text to disk
further arguments that might be passed to methods (not used at the moment)