Re: [R] Error in combined for() and if() code

2010-12-28 Thread Nathan Miller
Hi all, I haven't solved the problem of filtering the data, but I have managed to find all the peaks in the data despite their relatively flat nature using peaks() in the IDPmisc package. It works really well for my data and the ability to set a lower threshold for peaks to report is convenient as

Re: [R] Error in combined for() and if() code

2010-12-28 Thread David Winsemius
On Dec 28, 2010, at 1:08 PM, Nathan Miller wrote: 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 i

Re: [R] Error in combined for() and if() code

2010-12-28 Thread Duncan Murdoch
On 28/12/2010 1:13 PM, Uwe Ligges wrote: On 28.12.2010 19:08, Nathan Miller wrote: 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 wri

Re: [R] Error in combined for() and if() code

2010-12-28 Thread Uwe Ligges
On 28.12.2010 19:08, Nathan Miller wrote: 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$P

Re: [R] Error in combined for() and if() code

2010-12-28 Thread Duncan Murdoch
On 28/12/2010 1:08 PM, Nathan Miller wrote: 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$P

[R] Error in combined for() and if() code

2010-12-28 Thread Nathan Miller
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$P