Question: CODE IN R ( Cubic splines) I am dealing with the syntax error Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y'

CODE IN R ( Cubic splines) I am dealing with the syntax error " Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ "

When I input this into my R console:

{ R code.......... } dy = CubicSpline(0:10, sin(0:10), cos(0), cos(10)) x = c() y = c() for (i in 0:100) { x = c(x, i*0.1) y = c(y, CubicSplineValue(i*0.1, 0:10, sin(0:10), dy)) } plot(sin,from = 0, to = 10) plot(x,y) # trying to plot cubic spline values but I get an error about lengths x and y differing

What am I doing wrong?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!