title: R: Writing a function which has as its input a vector
body: <p>I started learning R recently and don't know how to write this:</p>
  
  <p>Write a function which has as its input a vector where each element is a positive integer below 500 000 000, and which returns each element of the input vector which is a cube number.</p>
  
  <p>When I got a single value x, I usually start with:</p>
  
  <pre><code>my.function &lt;- function(x) {
  </code></pre>
  
  <p>However what if I want a vector as outlined above?
  I was thinking of defining x as below:</p>
  
  <pre><code>my.function &lt;- function(x) { 
  x &lt;- c(0&lt;n&lt;500000000)
  </code></pre>
  
  <p>but this does not work.
  How can I do this?</p>