title: Assign a value, if a number is in between two numbers
body: <p>Im trying to assign the value of -1, to every number in my vector that is inbetween 2 and 5.</p>
  <p>I thought an if - then statement would work. I am having some trouble. I dont think (2&lt;x&lt;5) is right but I am not sure how to write inbetween in R. Can anyone help? Thanks</p>
  <pre><code>x &lt;- c(3.2,6,7.8,1,3,2.5)
  if (2&lt;x&lt;5){
      cat(-1)
  } else {
      cat (x)
  }
  </code></pre>