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 file</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 {brio}"><tr><td>writeLines {brio}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Write lines to a file</h2> <h3>Description</h3> <p>This is a drop in replacement for <code><a href="../../base/html/writeLines.html">base::writeLines()</a></code> with restricted functionality. Compared to <code><a href="../../base/html/writeLines.html">base::writeLines()</a></code> it: </p> <ul> <li><p> Only works with file paths, not connections. </p> </li> <li><p> Uses <code><a href="../../base/html/Encoding.html">enc2utf8()</a></code> to convert <code>text()</code> to UTF-8 before writing. </p> </li> <li><p> Uses <code>sep</code> unconditionally as the line ending, regardless of platform. </p> </li> <li><p> The <code>useBytes</code> argument is ignored, with a warning. </p> </li></ul> <h3>Usage</h3> <pre> writeLines(text, con, sep = "\n", useBytes) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>text</code></td> <td> <p>A character vector to write</p> </td></tr> <tr valign="top"><td><code>con</code></td> <td> <p>A character string of the path to a file. Throws an error if a connection object is passed.</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>The end of line characters to use between lines.</p> </td></tr> <tr valign="top"><td><code>useBytes</code></td> <td> <p>Ignored, with a warning.</p> </td></tr> </table> <h3>Value</h3> <p>The UTF-8 encoded input text (invisibly). </p> <h3>See Also</h3> <p><code><a href="readLines.html">readLines()</a></code> </p> <h3>Examples</h3> <pre> tf <- tempfile() writeLines(rownames(mtcars), tf) # Trying to use connections throws an error con <- file(tf) try(writeLines(con)) close(con) # Trying to use unsupported args throws a warning writeLines(rownames(mtcars), tf, useBytes = TRUE) unlink(tf) </pre> <hr /><div style="text-align: center;">[Package <em>brio</em> version 1.1.3 <a href="00Index.html">Index</a>]</div> </body></html>