title: why is my R function not printing values?
body: <pre><code>  s &lt;- seq(-10, 6, by = 0.1)
  
    my.fun = function(s) 
    { 
      n = length(s)
      s = 0
      for(i in 1:n)
      {     
        s = ((s[i]*s[i]*s[i]*s[i])*sin(1/s[i]) +(s[i]*s[i]))/(1+abs((s[i]*s[i]*s[i])))
      }
      s
    }
  </code></pre>
  
  <p>This is my function. I am attempting to compute a sequence of numbers and then use that sequence within the equation. However, It isnt saving the new variable S and the function wont print anything out either. </p>