thin | R Documentation |
Systematic sampling of every thin
'th row of a matrix or vector.
Useful for culling MCMC output or denoising a plot.
thin(x, thin)
x |
The array to be thinned. The first dimension is the one sampled over. |
thin |
The frequency of observations to keep. With |
The thinned vector, matrix, or array is returned.
Steven L. Scott
x <- rnorm(100)
thin(x, 10)
# returns a 10 vector
y <- matrix(rnorm(200), ncol=2)
thin(y, 10)
# returns a 10 by 2 matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.