Re: [R] problem in plot after calculating the derivative

2011-03-08 Thread David Winsemius
On Mar 8, 2011, at 12:39 AM, Hong Qin wrote: Here is a test code to calculate the derivative of a curve in sliding windows. I generated a linear example, and it should plot the derivative in a straight line. But, it does not?! Try adding ylim=c(0.1). You will get your straight line. I cons

[R] problem in plot after calculating the derivative

2011-03-07 Thread Hong Qin
Here is a test code to calculate the derivative of a curve in sliding windows. I generated a linear example, and it should plot the derivative in a straight line. But, it does not?! -- x = seq(0,10,by=0.1) y = x * 0.5 + 0.1 window=15; half = floor( window/2) x2 = half: (length(x)-hal