Solution for rankall problem, using a pre-allocated matrix and turning it later into a data.frame (does that make any sense?!)