Re: [R] deconstructing curve into rising and falling limbs

2012-10-26 Thread chuck.01
Thanks Jean, Your 1st solution was one I've tried, w/o great success. The 2nd works a lot better (on real, and more messy, data), especially when I set span to a much smaller number than 1/10. Thank you greatly. -Chuck Jean V Adams wrote > Using the data you provided, a combination of slope

Re: [R] deconstructing curve into rising and falling limbs

2012-10-26 Thread Jean V Adams
Using the data you provided, a combination of slope and height comes close: X <- seq(Y) high <- Y > 0.6 upslope <- c(FALSE, diff(Y) > 0) section <- rep(1, length(Y)) section[upslope==TRUE & high==TRUE] <- 2 section[upslope==FALSE & high==TRUE] <- 3 plot(X, Y, col=section) Or you could base the

[R] deconstructing curve into rising and falling limbs

2012-10-26 Thread chuck.01
hello, I have some data that looks similar to this (only not as nice as this): Y <- c(abs(rnorm(100, 0.10, .1)), seq(.10, 1.0, .3)+rnorm(1, 0, .5) , seq(0.8, 4.0, .31)+rnorm(1, 0, .5) , seq(3.9, .20, -.2)+rnorm(1, 0, .5) , abs(rnorm(100, 0.13, .1)) , seq(.10, 1.2, .35)+rnorm(1, 0, .5) , seq(0.7,