| writeLines | R Documentation |
Write text lines to a connection.
writeLines(text, con = stdout(), sep = "\n", useBytes = FALSE)
text | A character vector |
con | A connection object or a character string. |
sep | character string. A string to be written to the connectionafter each line of text. |
useBytes | logical. See ‘Details’. |
If thecon is a character string, the function callsfile to obtain a file connection which is opened forthe duration of the function call.(tilde expansion of the file path is done byfile.)
If the connection is open it is written from its current position.If it is not open, it is opened for the duration of the call in"wt" mode and then closed again.
NormallywriteLines is used with a text-mode connection, and thedefault separator is converted to the normal separator for thatplatform (LF on Unix/Linux, CRLF on Windows). For more control, opena binary connection and specify the precise value you want written tothe file insep. For even more control, usewriteChar on a binary connection.
useBytes is for expert use. Normally (when false) characterstrings with marked encodings are converted to the current encodingbefore being passed to the connection (which might do furtherre-encoding).useBytes = TRUE suppresses the re-encoding ofmarked strings so they are passed byte-by-byte to the connection:this can be useful when strings have already been re-encoded bye.g.iconv. (It is invoked automatically for stringswith marked encoding"bytes".)
connections,writeChar,writeBin,readLines,cat
Add the following code to your website.
For more information on customizing the embed code, readEmbedding Snippets.
