Displaying 1 result from an estimated 1 matches for "newphase".
Did you mean:
  newpage
  
2010 Dec 28
3
Error in combined for() and if() code
Hello,
I am trying to filter a data set like below so that the peaks in the Phase
value are more obvious and can be identified by a peak finding function
following the useful advise of Carl Witthoft. I have written the following
for(i in length(data$Phase)){
newphase=if(abs(data$Phase[i+1]-data$Phase[i])>6){
data$Phase[i+1]
}else{data$Phase[i]
}
}
I get the following error which I have not seen before when I paste the code
into R
Error in if (abs(data$Phase[i + 1] - data$Phase[i]) > 6) { :
  missing value where TRUE/FALSE needed
I don't have much e...