blob: 94a55e596dec03f2a9c7f663a70eda4991862cd1 [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: over</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 over {SparkR}"><tr><td>over {SparkR}</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>over</h2>
<h3>Description</h3>
<p>Define a windowing column.
</p>
<h3>Usage</h3>
<pre>
over(x, window)
## S4 method for signature 'Column,WindowSpec'
over(x, window)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
<p>a Column, usually one returned by window function(s).</p>
</td></tr>
<tr valign="top"><td><code>window</code></td>
<td>
<p>a WindowSpec object. Can be created by <code>windowPartitionBy</code> or
<code>windowOrderBy</code> and configured by other WindowSpec methods.</p>
</td></tr>
</table>
<h3>Note</h3>
<p>over since 2.0.0
</p>
<h3>See Also</h3>
<p>Other colum_func: <code><a href="alias.html">alias</a></code>,
<code><a href="between.html">between</a></code>, <code><a href="cast.html">cast</a></code>,
<code><a href="endsWith.html">endsWith</a></code>, <code><a href="otherwise.html">otherwise</a></code>,
<code><a href="startsWith.html">startsWith</a></code>, <code><a href="substr.html">substr</a></code>
</p>
<h3>Examples</h3>
<pre><code class="r">## Not run:
##D df &lt;- createDataFrame(mtcars)
##D
##D # Partition by am (transmission) and order by hp (horsepower)
##D ws &lt;- orderBy(windowPartitionBy(&quot;am&quot;), &quot;hp&quot;)
##D
##D # Rank on hp within each partition
##D out &lt;- select(df, over(rank(), ws), df$hp, df$am)
##D
##D # Lag mpg values by 1 row on the partition-and-ordered table
##D out &lt;- select(df, over(lead(df$mpg), ws), df$mpg, df$hp, df$am)
## 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>