Displaying 1 result from an estimated 1 matches for "2counter".
Did you mean:
counter
2008 Feb 29
2
while loop syntax help
...ue 2 and also > value3, then == row(Value 1). Else, go to the next Value. However, output returns "NULL", no matter how I've modified the syntax.
Thanks in advance for any help.
Zack
#############################
x <- c(5,5,7,6,5,4,3) x <- data.frame(x)
y <-length(x)-2counter <- 1
output = c()
while(counter <= y) {
counter1 <- counter+1counter2 <- counter+2
if(x[counter,1] > x[counter1,1]|| x[counter1,1] > x[counter2,1]){output = x[counter, ]
} else {
counter = counter+1
}
counter = y}########################################
[[alternative HTML vers...