Hi,
I’m trying to get smooth curves connecting points in a plot using
spline but I don’t get what I whant.
Eg.:
x-1:5
y - c(0.31, 0.45, 0.84, 0.43, 0.25)
plot(x,y)
lines(spline(x,y))
Creates a valley between the first and second points, then peaks at 3rd,
and another valley between 4th and
how about:
require(splines)
x-1:5
y - c(0.31, 0.45, 0.84, 0.43, 0.25)
yy -predict(interpSpline(x, y))
plot(x, y)
lines(yy)
Katharine Mullen
mail: Department of Physics and Astronomy, Faculty of Sciences
Vrije Universiteit Amsterdam, de Boelelaan 1081
1081 HV Amsterdam, The Netherlands
, September 19, 2007 2:09 PM
To: [EMAIL PROTECTED]
Subject: [R] Smooth line in graph
Hi,
I'm trying to get smooth curves connecting points in a plot
using spline but I don't get what I whant.
Eg.:
x-1:5
y - c(0.31, 0.45, 0.84, 0.43, 0.25)
plot(x,y)
lines(spline(x,y))
Creates a valley
3 matches
Mail list logo