Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started