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)
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", ...)
|
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) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.