> can´t believe in need a loop for this... No, you don't ;) > want to get a 100 x 1 vector Has each row unique values? If yes: mat <- matrix(rnorm(300),nr=100) vet <- apply(mat,1,function(x) {return(which(x==max(x)))}) scionforbai