blob: 49f532a9cf1806762f944310e1d755002d878c59 [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: structField</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 structField {SparkR}"><tr><td>structField {SparkR}</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>structField</h2>
<h3>Description</h3>
<p>Create a structField object that contains the metadata for a single field in a schema.
</p>
<h3>Usage</h3>
<pre>
structField(x, ...)
## S3 method for class 'jobj'
structField(x, ...)
## S3 method for class 'character'
structField(x, type, nullable = TRUE, ...)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
<p>the name of the field.</p>
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
<p>additional argument(s) passed to the method.</p>
</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
<p>The data type of the field</p>
</td></tr>
<tr valign="top"><td><code>nullable</code></td>
<td>
<p>A logical vector indicating whether or not the field is nullable</p>
</td></tr>
</table>
<h3>Value</h3>
<p>A structField object.
</p>
<h3>Note</h3>
<p>structField since 1.4.0
</p>
<h3>Examples</h3>
<pre><code class="r">## Not run:
##D field1 &lt;- structField(&quot;a&quot;, &quot;integer&quot;)
##D field2 &lt;- structField(&quot;c&quot;, &quot;string&quot;)
##D field3 &lt;- structField(&quot;avg&quot;, &quot;double&quot;)
##D schema &lt;- structType(field1, field2, field3)
##D df1 &lt;- gapply(df, list(&quot;a&quot;, &quot;c&quot;),
##D function(key, x) { y &lt;- data.frame(key, mean(x$b), stringsAsFactors = FALSE) },
##D schema)
## 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>