Skip to content
Prev 277612 / 398506 Next

Checking for monotonic sequence

Happy to help, but could you provide a dput() example of your data
div1 -- I'm not sure if your table elements are coded as factors or
doubles and that can make quite a difference.

Anyways, once you confirm they are doubles, something like this will do it:

apply(D, 1, function(x) all(diff(x)>0))

E.g.

D <- matrix(c(1,2,3,4,2,5,7,7,9), 3)

Michael
On Wed, Nov 16, 2011 at 10:49 AM, Mark Carter <mcturra2000 at yahoo.co.uk> wrote: