[R] Plotting one dot in a graph

TGS cran.questions at gmail.com
Thu Aug 12 21:54:53 CEST 2010


Actually I spoke too soon David.

I'm looking for a function that will either tell me which point is the intersection so that I'd be able to plot a point there.

Or, if I have to solve for the roots in the ways which were demonstrated yesterday, then would I be able to specify what the horizontal line is, for instance in the case where y (is-not) 0?

On Aug 12, 2010, at 12:47 PM, David Winsemius wrote:


On Aug 12, 2010, at 3:43 PM, TGS wrote:

> I'd like to plot a point at the intersection of these two curves. Thanks
> 
> x <- seq(.2, .3, by = .01)
> f <- function(x){
> 	x*cos(x)-2*x**2+3*x-1
> }
> 
> plot(x,f(x), type = "l")
> abline(h = 0)

Would this just be the uniroot strategy applied to "f"? You then plot the x and y values with points()

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list