EVOLUTION-MANAGER
Edit File: read_lines.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: Read text lines from 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 read_lines {brio}"><tr><td>read_lines {brio}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Read text lines from a file</h2> <h3>Description</h3> <p>The file is assumed to be UTF-8 and the resulting text has its encoding set as such. </p> <h3>Usage</h3> <pre> read_lines(path, n = -1) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>path</code></td> <td> <p>A character string of the path to the file to read.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>integer. The number of lines to read. A negative number means read all the lines in the file.</p> </td></tr> </table> <h3>Details</h3> <p>Both '\r\n' and '\n' are treated as a newline. </p> <h3>Value</h3> <p>A UTF-8 encoded character vector of the lines in the file. </p> <h3>Examples</h3> <pre> authors_file <- file.path(R.home("doc"), "AUTHORS") data <- read_lines(authors_file) </pre> <hr /><div style="text-align: center;">[Package <em>brio</em> version 1.1.3 <a href="00Index.html">Index</a>]</div> </body></html>