Here is my data example:
>dat <- matrix(c(59,50,48,44,44,NA,78,59,42,67,51,NA,72,64,64),byrow=TRUE,ncol=3) >k <- apply(dat, 1, function(x) whic
You can use max.col(-dat, "last"), but you'll have to set NAs to Inf first.
max.col(-dat, "last")
NA
Inf