blob: 46ab5fe7b95487cddfa801d08feadf6de431d9ae [file] [log] [blame]
<!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: Create a SparkDataFrame from a text file.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/github.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/languages/r.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head><body>
<table width="100%" summary="page for read.text {SparkR}"><tr><td>read.text {SparkR}</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>Create a SparkDataFrame from a text file.</h2>
<h3>Description</h3>
<p>Loads text files and returns a SparkDataFrame whose schema starts with
a string column named &quot;value&quot;, and followed by partitioned columns if
there are any.
</p>
<h3>Usage</h3>
<pre>
## Default S3 method:
read.text(path, ...)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>path</code></td>
<td>
<p>Path of file to read. A vector of multiple paths is allowed.</p>
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
<p>additional external data source specific named properties.</p>
</td></tr>
</table>
<h3>Details</h3>
<p>Each line in the text file is a new row in the resulting SparkDataFrame.
</p>
<h3>Value</h3>
<p>SparkDataFrame
</p>
<h3>Note</h3>
<p>read.text since 1.6.1
</p>
<h3>Examples</h3>
<pre><code class="r">## Not run:
##D sparkR.session()
##D path &lt;- &quot;path/to/file.txt&quot;
##D df &lt;- read.text(path)
## End(Not run)
</code></pre>
<hr /><div style="text-align: center;">[Package <em>SparkR</em> version 2.4.0 <a href="00Index.html">Index</a>]</div>
</body></html>