title: How to estimate x value from y value input after approxfun() in R
body: <p>I would like to use <code>approxfun</code> or a similar method to estimate a function for a curve and then estimate what the <code>x</code> value of a point would be given a known <code>y</code> value. </p>
  
  <p>Here is a simplified example.</p>
  
  <pre><code>y &lt;- seq(from=1, to =10, by = 1)
  
  x &lt;-seq(from=0.1, to =1, by = 0.1)
  
  fun &lt;- approxfun(x,y)
  </code></pre>
  
  <p>I can approximate a <code>y</code> value given a known <code>x</code> value with the following command:</p>
  
  <pre><code>fun(0.65)
  #[1] 6.5
  </code></pre>
  
  <p>But how can I do the reverse, i.e., solve <code>x</code> from <code>6.5 = approxfun(x)</code>?</p>
  
  <p>Thanks for any help on my most likely dumb question.</p>