Hi,
thanks a lot!
I probably did not express myself very well. Basically I need to detect microsaccades in a series of files, which are data from different participants.
I have the script to detect MS ...
lxdeg <- (lx - (SCREEN_WIDTH_PX/2)) / resx
lydeg <- (ly - (SCREEN_HEIGHT_PX/2)) / resy
rxdeg <- (rx - (SCREEN_WIDTH_PX/2)) / resx
rydeg <- (ry - (SCREEN_HEIGHT_PX/2)) / resy
#---------------------------------------------------
4. Detection of microsaccades
This is all E&K code - with a tweak in microsacc.R
to avoid PSOs. Adjust MINDUR and VFAC as desired
#---------------------------------------------------
xl <- cbind(lxdeg,lydeg)
xr <- cbind(rxdeg,rydeg)
msl <- microsacc(xl,VFAC,MINDUR,SAMPLING)
msr <- microsacc(xr,VFAC,MINDUR,SAMPLING)
sac <- binsacc(msl$table,msr$table)
sacpar_out <- sacpar(sac,SAMPLING=1000)
output[[i]] <- cbind(rep(i,nrow(sacpar_out)),sacpar(sac,SAMPLING=1000))
}
so I need to open all files and then, at the end, create a report for each file with the frequency of microsaccades per trial.
Does your script also work with the write.table function to create the report?
myData2 = read.table(myFile)
sac_file <- do.call(rbind, lapply(output, as.data.frame))
colnames <- c('trial','start','end','duration','delay','peakv','distance','orient1','amp','orient2')
write.table(sac_file, file = "sacc.txt", sep = "\t")
the write.table function applied to all files