read_utf8 | R Documentation |
Read or write files, assuming they are encoded in UTF-8. read_utf8()
is
roughly readLines(encoding = 'UTF-8')
(a warning will be issued if non-UTF8
lines are found), and write_utf8()
calls writeLines(enc2utf8(text), useBytes = TRUE)
.
read_utf8(con, error = FALSE)
write_utf8(text, con, ...)
append_utf8(text, con, sort = TRUE)
append_unique(text, con, sort = function(x) base::sort(unique(x)))
con |
A connection or a file path. |
error |
Whether to signal an error when non-UTF8 characters are detected
(if |
text |
A character vector (will be converted to UTF-8 via |
... |
Other arguments passed to |
sort |
Logical ( |
The function append_utf8()
appends UTF-8 content to a file or connection
based on read_utf8()
and write_utf8()
, and optionally sort the content.
The function append_unique()
appends unique lines to a file or connection.
read_utf8()
returns a character vector of the file content;
write_utf8()
returns the con
argument (invisibly).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.