title: Looping through seq with negative numbers in R
body: <p>This is probably very simple, but I am having trouble getting R to loop through negative numbers. I have tried using seq(-10,10,1), I have tried using seq(from=-10, to=10, by=1)
  What I get is either b values of 1-10 or 1-21. I need it to be from -10 to 10. What am I missing in here? Any help is very appreciated.</p>
  <p>Here is my current attempt at the code:</p>
  <pre><code>pr1 &lt;- NULL
  i &lt;- 1
  t = seq(from = -10, to = 10, by = 1)
  
  for (b in seq(t)) {
    LLF &lt;- sum(1*log((1/(1+exp(-(b)))))+(1-1)*log(1-(1/(1+exp(-(b))))))
    like[b] &lt;- LLF
    pr[b] &lt;- b 
  }
  pr
  df &lt;-data.frame(like, pr)```
  </code></pre>