title: best fitting curve from plot in R
body: <p>I have a probability density function in a plot called ph that i derived from two samples of data, by the help of a user of stackoverflow, in this way</p>
  
  <pre><code> few &lt;-read.table('outcome.dat',head=TRUE)
   many&lt;-read.table('alldata.dat',head=TRUE)
   mh &lt;- hist(many$G,breaks=seq(0,1.,by=0.03), plot=FALSE)
   fh &lt;- hist(few$G, breaks=mh$breaks, plot=FALSE)
   ph &lt;- fh
   ph$density &lt;- fh$counts/(mh$counts+0.001)
   plot(ph,freq=FALSE,col="blue")
  </code></pre>
  
  <p>I would like to fit the best curve of the plot of ph, but i can't find a working method. 
  how can i do this? I have to extract the vaule from ph and then works on they? or there is same function that works on </p>
  
  <pre><code> plot(ph,freq=FALSE,col="blue")
  </code></pre>
  
  <p>directly?</p>