blob: 591db697fa3704879f5f453921e88fef6ce28667 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><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 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 align="center">[Package <em>SparkR</em> version 2.1.1 <a href="00Index.html">Index</a>]</div>
</body></html>