fdx <- function(orea) { sakkt <- maxima( orea$z, limit=16*median(orea$z) ) tmp <- sakkt[-1]-sakkt[-length(sakkt)]>800 fix <- data.frame(a=sakkt[c(tmp,F)]+30,e=sakkt[c(F,tmp)]-15) fix$vs.a <- apply( fix, 1, function(x) { with(orea[x[1]+1:400,],mean(oz.hl+oz.hr,trim=0.1))/2}) fix$vs.e <- apply( fix, 1, function(x) { with(orea[x[2]-400+1:400,],mean(oz.hl+oz.hr,trim=0.1))/2}) fix$vs.1 <- apply( fix, 1, function(x) { with(orea[x[1]+1:100,],mean(oz.hl+oz.hr,trim=0.1))/2}) fix$vs.2 <- apply( fix, 1, function(x) { with(orea[x[1]+100+1:100,],mean(oz.hl+oz.hr,trim=0.1))/2}) fix$vg.a <- apply( fix, 1, function(x) { with(orea[x[1]+1:400,],mean(oz.hl-oz.hr,trim=0.1))}) fix$vg.e <- apply( fix, 1, function(x) { with(orea[x[2]-400+1:400,],mean(oz.hl-oz.hr,trim=0.1))}) fix$vg.1 <- apply( fix, 1, function(x) { with(orea[x[1]+1:100,],mean(oz.hl-oz.hr,trim=0.1))}) fix$vg.2 <- apply( fix, 1, function(x) { with(orea[x[1]+100+1:100,],mean(oz.hl-oz.hr,trim=0.1))}) fix$vg.3 <- apply( fix, 1, function(x) { with(orea[x[1]+200+1:100,],mean(oz.hl-oz.hr,trim=0.1))}) fix } for( fn in names(ausw.liste.bak)) { load(paste(fn,".oz",sep="")) ausw.liste.bak[[fn]]$fixs <- fdx(orea) } fix.s <- cbind(trial=fn,ausw.liste.bak[[fn]]$fixs)[0,] tmp <- names(ausw.liste.bak) tmp <- tmp[Typ[substring(tmp,5,8)]!="FDo"] for( fn in tmp ) fix.s <- rbind(fix.s, cbind(trial=fn,ausw.liste.bak[[fn]]$fixs)) fix.s$trial <- as.character(fix.s$trial) fix.s$target <- factor(ifelse(abs(fix.s$vs.a)<2,"M",ifelse(abs(fix.s$vs.a+5)<2,"L",ifelse(abs(fix.s$vs.a-5)<2,"R",NA)))) fix.s$target[abs(fix.s$vs.a-fix.s$vs.e)>2] <- NA fix.s$trial <- as.character(fix.s$trial) fix.s$VP <- substring(fix.s$trial,1,3) fix.s$cond <- substring(fix.s$trial,5,8) fix.s$VP <- factor(fix.s$VP,levels=rownames(subj.VP.mean)[order(subj.VP.mean$HPh +subj.VP.mean$wcor)]) boxplot(vg.3~target*VP,subset(fix.s,!is.na(target)),col=2:4)