rmat <- function(file){ temp <- scan(file) dims <- temp[1:2] temp <- temp[-c(1,2)] matrix(temp,nr=dims[1],byrow=T) }