Hi
If Xsplines give you the shape you want, then you can retrieve points on
the boundary of the shape using xsplinePoints(). For example ...
shapepoints <- structure(list(x = c(8.9, 0, -7.7, 0, 8.9),
y = c(0, 2, 0, -3.8, 0)),
.Names =
Dear Allie,
You could use elliptic fourier analysis
shapepoints = structure(list(x = c(8.9, 0, -7.7, 0, 8.9), y = c(0, 2, 0,
-3.8,
0)), .Names = c("x", "y"), row.names = c(NA, -5L), class = "data.frame")
shapepoints$Theta <- seq(0, 2 * pi, length = nrow(shapepoints))
model <- lm(cbind(x, y) ~
in
> Sent: 21 March 2016 14:04
> To: r-help
> Subject: Re: [R] Fit a smooth closed shape through 4 points
>
> Thanks for your reply, Charles. spline() doesn't seem to fit a closed shape;
> rather, it's producing a parabola. Perhaps I'm missing an argument I should
> incl
Thanks for your reply, Charles. spline() doesn't seem to fit a closed
shape; rather, it's producing a parabola. Perhaps I'm missing an
argument I should include?
grid.xspline() seems to get close to what I need, but it returns a grob
object - not sure how to work with those as shapes per
Hi Allie,
What is you goal here? Do you just want to plot a curve to the data? Do
you want a function to approximate the data?
You may find the functions spline() and splinefun() useful.
Quick point though, with so few points you are only going to get a very
rough approximation no matter the
Hello all,
I have sets of 4 x/y points through which I would like to fit closed,
smoothed shapes that go through those 4 points exactly. smooth.spline
doesn't like my data, since there are only 3 unique x points, and even
then, i'm not sure smooth.spline likes making closed shapes.
Might
6 matches
Mail list logo