I am new in R and I am stuck in a silly error.. Although I found some questions that tackle my problem I can't solve it.
ww <- waveMC_list[[5]]
sampling=44100
thresh=10
timer.output <- timer(ww, f=sampling, threshold=thresh,envt="abs",ksmooth=kernel("daniell",100))
i=0
min.length=0.05 # minimum length of segment
segmts=length(timer.output[[4]]) # total amount of segments to evaluate
segments <- list() # output of valid segments
starts=timer.output[[4]] # starting times
ends=timer.output[[5]] # ending times
for(i in 1:segmts)
{
if(i <= segmts)
{
while(starts[i] <= ends[i]) #print(TRUE)
{
if((ends[i]-starts[i])>min.length)
{
segments[[i]] <- env(WaveMC(cutw(ww, f=44100, from= starts[i], to=ends[i],plot=F), bit= 16, samp.rate=44100)
, f=44100, ksmooth=kernel("daniell",90),plot=F)
print(paste('check', i, sep=' '))
print(segmts)
#env("ACAWAVEFILE", f=44100, ksmooth=kernel("daniell",90))
}
i=i+1
}
}
}
Error in while (starts[i] <= ends[i]) { :
missing value where TRUE/FALSE needed