Skip to content

Odp: Help How to use a loop to do pair comparison

1 message · PIKAL Petr

#
Hi

r-help-bounces at r-project.org napsal dne 24.02.2009 06:23:23:
Well. It is a little cryptic what you want. 

Suppose you have 100 x values. What is x value number 101? 

If you want to check if subsequent value is bigger or smaller then 
previous one use

diff(x) and test diff(x)>0.

Regards
Petr
give me
http://www.R-project.org/posting-guide.html