blob: 8fbff14252998822017e9107ed4673636a6c8be0 [file] [log] [blame]
<!DOCTYPE html><html><head><title>R: substr</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.css">
<script type="text/javascript">
const macros = { "\\R": "\\textsf{R}", "\\code": "\\texttt"};
function processMathHTML() {
var l = document.getElementsByClassName('reqn');
for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }
return;
}</script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.js"
onload="processMathHTML();"></script>
<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><div class="container">
<table style="width: 100%;"><tr><td>substr {SparkR}</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>substr</h2>
<h3>Description</h3>
<p>An expression that returns a substring.
</p>
<h3>Usage</h3>
<pre><code class='language-R'>## S4 method for signature 'Column'
substr(x, start, stop)
</code></pre>
<h3>Arguments</h3>
<table>
<tr style="vertical-align: top;"><td><code>x</code></td>
<td>
<p>a Column.</p>
</td></tr>
<tr style="vertical-align: top;"><td><code>start</code></td>
<td>
<p>starting position. It should be 1-base.</p>
</td></tr>
<tr style="vertical-align: top;"><td><code>stop</code></td>
<td>
<p>ending position.</p>
</td></tr>
</table>
<h3>Note</h3>
<p>substr since 1.4.0
</p>
<h3>See Also</h3>
<p>Other column_func:
<code><a href="../../SparkR/help/alias.html">alias</a>()</code>,
<code><a href="../../SparkR/help/between.html">between</a>()</code>,
<code><a href="../../SparkR/help/cast.html">cast</a>()</code>,
<code><a href="../../SparkR/help/endsWith.html">endsWith</a>()</code>,
<code><a href="../../SparkR/help/otherwise.html">otherwise</a>()</code>,
<code><a href="../../SparkR/help/over.html">over</a>()</code>,
<code><a href="../../SparkR/help/startsWith.html">startsWith</a>()</code>
</p>
<h3>Examples</h3>
<pre><code class="r">## Not run:
##D df &lt;- createDataFrame(list(list(a=&quot;abcdef&quot;)))
##D collect(select(df, substr(df$a, 1, 4))) # the result is `abcd`.
##D collect(select(df, substr(df$a, 2, 4))) # the result is `bcd`.
## End(Not run)
</code></pre>
<hr /><div style="text-align: center;">[Package <em>SparkR</em> version 3.2.2 <a href="00Index.html">Index</a>]</div>
</div>
</body></html>