Skip to content
Prev 178782 / 398506 Next

selecting ith rows of a matrix

probably you want to use seq(), e.g.,

mat <- matrix(1:500, 100, 5)

mat[seq(1, nrow(mat), 2), ]
mat[seq(1, nrow(mat), 3), ]
mat[seq(1, nrow(mat), 4), ]


I hope it helps.

Best,
Dimitris
Umesh Srinivasan wrote: