title: What is the function of $y at the end of an interpolation function?
body: <p>I am learning interpolation using R. I found a code online and I am not sure about the function of <strong><code>$y</code></strong> at the end of the code. I tried to run the code with and without <strong><code>$y</code></strong> and I cannot really tell the differences.</p>
  <pre class="lang-r prettyprint-override"><code>test &lt;- approx(x, y, xout=c, rule=2) $y
  </code></pre>