EVOLUTION-MANAGER
Edit File: writeLines.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Write Lines to a Connection</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for writeLines {base}"><tr><td>writeLines {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Write Lines to a Connection</h2> <h3>Description</h3> <p>Write text lines to a connection. </p> <h3>Usage</h3> <pre> writeLines(text, con = stdout(), sep = "\n", useBytes = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>text</code></td> <td> <p>A character vector</p> </td></tr> <tr valign="top"><td><code>con</code></td> <td> <p>A <a href="connections.html">connection</a> object or a character string.</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>character string. A string to be written to the connection after each line of text.</p> </td></tr> <tr valign="top"><td><code>useBytes</code></td> <td> <p>logical. See ‘Details’.</p> </td></tr> </table> <h3>Details</h3> <p>If the <code>con</code> is a character string, the function calls <code><a href="connections.html">file</a></code> to obtain a file connection which is opened for the duration of the function call. </p> <p>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 <code>"wt"</code> mode and then closed again. </p> <p>Normally <code>writeLines</code> is used with a text-mode connection, and the default separator is converted to the normal separator for that platform (LF on Unix/Linux, CRLF on Windows). For more control, open a binary connection and specify the precise value you want written to the file in <code>sep</code>. For even more control, use <code><a href="readChar.html">writeChar</a></code> on a binary connection. </p> <p><code>useBytes</code> is for expert use. Normally (when false) character strings with marked encodings are converted to the current encoding before being passed to the connection (which might do further re-encoding). <code>useBytes = TRUE</code> suppresses the re-encoding of marked strings so they are passed byte-by-byte to the connection: this can be useful when strings have already been re-encoded by e.g. <code><a href="iconv.html">iconv</a></code>. (It is invoked automatically for strings with marked encoding <code>"bytes"</code>.) </p> <h3>See Also</h3> <p><code><a href="connections.html">connections</a></code>, <code><a href="readChar.html">writeChar</a></code>, <code><a href="readBin.html">writeBin</a></code>, <code><a href="readLines.html">readLines</a></code>, <code><a href="cat.html">cat</a></code> </p> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>