thin.matrix {Boom} | R Documentation |
Thin a Matrix
Description
Return discard all but every k'th row of a matrix.
Usage
ThinMatrix(mat, thin)
Arguments
mat |
The matrix to be thinned. |
thin |
The distance between kepts lines from mat. The larger the number the fewer lines are kept. |
Details
The bigger the value of thin
the more thinning that gets done.
For example, thin = 10
will keep every 10 lines from mat
.
Value
The matrix mat, after discarding all but every thin
lines.
Author(s)
Steven L. Scott steve.the.bayesian@gmail.com
Examples
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
[Package Boom version 0.9.15 Index]