powered by
Return discard all but every k'th row of a matrix.
ThinMatrix(mat, thin)
The matrix mat, after discarding all but every thin lines.
thin
The matrix to be thinned.
The distance between kepts lines from mat. The larger the number the fewer lines are kept.
Steven L. Scott steve.the.bayesian@gmail.com
The bigger the value of thin the more thinning that gets done. For example, thin = 10 will keep every 10 lines from mat.
thin = 10
mat
m <- matrix(1:100, ncol = 2) ThinMatrix(m, thin = 10) ## [,1] [,2] ## [1,] 10 60 ## [2,] 20 70 ## [3,] 30 80 ## [4,] 40 90 ## [5,] 50 100
Run the code above in your browser using DataLab