Dear All,

Let  499 piece-wise lines were buit up by 500 pair of observations, via R code 
below.

x <- 1:500
y <- rnorm(500)
plot(x, y, type = 'b')

I was trying to compute all the slopes for the  lines which were connected 
between two adjacent points. For instance, slopes of lines between first and 
second points, second and third points, and so on, until between  points 499 
and 500, respectively, but sadly, i never found a suitable function do this 
computatation efficiently.

Could someone please advice me on doing this?

Thank you
Fir


    
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to