spread {extracat} | R Documentation |
Replaces each element of a matrix with a submatrix (containing this element) with a prespecified number of rows and columns.
spread(M, ncol = 1, nrow = 1)
M |
The matrix to be expanded. |
ncol |
The number of column repetitions. |
nrow |
The number of row repetitions. |
A matrix.
This function will be advanced in the future to support more than two dimensions.
Alexander Pilhoefer
Department for Computer Oriented Statistics and Data Analysis
University of Augsburg
Germany
Alexander Pilhoefer New approaches in visualization of categorical data:
R-package extracat
Journal of Statistical Software, submitted Jan 2010
M = matrix(1:12, ncol=4) spread(M, ncol = 5, nrow = 7)