title: How to apply a formula to a vector in R?
body: <p>not for the first time, I guess that the answer is quite simple. But searching for R solutions is regularly hard work and after two hours its probably at time to ask someone...</p>
  
  <p>I am working with a non-linear formula (this is only the first work on it, it will actually become non-linear soon) and to test my initial values, i would like to simply calculate the values over a series of x values.</p>
  
  <p>Here is some code:</p>
  
  <pre><code>x &lt;- c(1,2,3,4,5,6,7,8,9,10,11,12) #etc
  y &lt;- c(NA,332,248,234,84,56,26,24,27,33,37,25) #etc
  # This is my formula I shall soon expand
  fEst &lt;- y ~ 1 / (x / a + 1) * b
  # Initial value
  a &lt;- 800
  # Initial value based on inverted formula and second measure
  b &lt;- y[2] * (x[2] / a + 1)
  
  # Can i use my formula fEst to do this step?
  p &lt;- 1 / (x / a + 1) * b
  </code></pre>
  
  <p>The point is that I am working on the formula - and it seems strange to make each change, twice...</p>
  
  <p>What I found was a package nls2 where something like this was possible and a function apply.a.formula which seems to be an element from another package - but as this is a very basic use of a function, I guess that the R base packe already has the appropriate functions. Just ... where?</p>
  
  <p>Thanks!</p>