Skip to content
Prev 323060 / 398503 Next

Retrieve specific y for a list of x on a ploted line

Hello,

I'm not sure I understand. If you assign the value of smooth.spline, 
you'll have a list with elements x and y:

dat <- read.table(text = "
  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
", header = TRUE)
dat

sp <- smooth.spline(dat)
plot(sp$x, sp$y, type="l")


Aren't the values of y you want in sp$y?

Hope this helps,

Rui Barradas

Em 06-05-2013 14:36, camille r?rolle escreveu: