This is my second time posting, so I hope I get the "reproducible example" thing right.
Here is the error,
Error in if ((sound[i, 3] < -10 & sound[min(81, i + 1), 3] > -10) | (sound[i, :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In Ops.factor(sound[i, 3], -10) : < not meaningful for factors
2: In Ops.factor(sound[min(81, i + 1), 3], -10) :
> not meaningful for factors
3: In Ops.factor(sound[i, 3], -10) : > not meaningful for factors
4: In Ops.factor(sound[min(81, i + 1), 3], -10) :
< not meaningful for factors
Here is the code,
> for(i in 3:length(sound[,2])){
+ if(sound[i,3]==-10){
+ soundout[m,7]=sound[i,2]
+ m=m+1}
+ if((sound[i,3]< -10&sound[min(81,i+1),3]>-10)|(sound[i,3]>-10&sound[min(81,i+1),3]< -10)){
+ soundout[m,7]=(10-sound[i,3])*(sound[i+1,2]-sound[i,2])/(sound[i+1,3]-sound[i,3])+sound[i,2]
+ m=m+1}}
Can someone please tell me how to make the factor sound[1,3] a numeric value? Thank you,