What is the equivalent of R simple interpolation of the cubic spline Matlab in 2D space, shown here , i.e.
n = 7; x = rand(n,1); y = rand(n,1); plot(x,y,'.') axis([0 1 0 1]) t = 1:n; ts = 1:1/10:n; xs = spline(t,x,ts); ys = spline(t,y,ts); hold on plot(xs,ys,'r'); hold off
I tried the variations in R, but they seem to require the ordering of the vector x, and digging into related issues did not lead me to further. Thanks...
source share