title: random walk function in R
body: <p>I have a random walk function</p>
  
  <pre><code>random.walk = function(n){
    return(cunsum(c(0, sample(c(-1, 1), size = n-1, replace =TRUE))))
  }
  </code></pre>
  
  <p>I would like to make recursive random walk function.
  what I did was</p>
  
  <pre><code>recursive.rwalk=function(n){
    return(random.walk(n-1) + random.walk(n))
  }
  </code></pre>
  
  <p>but then Im getting warning message. 
  Please help me out!
  Thanks</p>