Calculate row-wise maximum

I won’t vouch for its speed, but this at least avoids coercing to a matrix:

data[,mymax:=do.call(pmax,.SD)]

Leave a Comment