powered by
sums top rows of matrix uses median of row to determine row order
sumtop(x, top = 3)
a matrix
how many to rows to sum (default 3)
# NOT RUN { tmp <- rbind(rep(1,times = 4), rep(2,times=4), rep(3,times=4), rep(4,times=4)) res <- sumtop(tmp) stopifnot(res == c(9,9,9,9)) # }
Run the code above in your browser using DataLab