[R] Retrieve specific y for a list of x on a ploted line
camille rérolle
camille.rerolle at gmail.com
Mon May 6 15:36:35 CEST 2013
Dear list,
I'm trying to retrieve specific y for a list of x on a drawn line in the
plot area.
The line is plot with an other list of xy coordinates,which only serve to
plot the line.
Here is an example of the beginning of a table of initial coordinates which
permit to draw the line:
X Y
"1" 0 137.659166666667
"2" 2.502 152.623333333333
"3" 4.998 162.391333333333
"4" 7.501 170.753666666667
"5" 9.997 174.877
"6" 12.499 178.4275
"7" 15.002 184.565
"8" 17.498 189.8985
"9" 20 192.6885
[...]
Here is what I want to do:
dossier<- ### path of the table to read
table <- read.table(dossier)
curv<-plot(smooth.spline(table), type="l",xlim=c(0,100),ylim=c(0,255))
# Now the line is drawn
#For x in 1:100 on curv, I want to retrieve each
corresponding y and sort coordinates in a table.
I search on the forum, the RSiteSearch, the R-intro.pdf, and I read the book
of the most common graph packages...
But I don't find the specific answer for my problem.
Can you help me, please.
Kind regards
Camille
More information about the R-help
mailing list