title: Define a custom function that can be applied to anentire column or sequence of integers (R)
body: <p>I looked around for a solution, but I'm not sure how to ask this. I want to define a function in R that has only one argument but can be applied to a whole column.</p>
  
  <p>I tried the following (simplified) code:</p>
  
  <pre><code>my_function &lt;- function(x) {
      if (x &lt;= 75){
          return(0.793)
          }
      else {
          return(0.956)
          }       
  }
  </code></pre>
  
  <p>This works nicely when <code>x</code> takes a single numeric value. However, I would like to evaluate the following:</p>
  
  <pre><code>my_function(seq(from = 1, to = 1500, by = 1))
  </code></pre>
  
  <p>I don't know how to specify that x could be a vector when defining the function T01 though.</p>