squaretize | R Documentation |
Add missing rows or columns based on names and Duplicates rows and columns of a given a data frame.
squaretize(x, fill = 0, reorder = TRUE)
x |
an object to be coerced into matrix. |
fill |
character string used to fill the additional rows and/or columns. |
reorder |
a logical. Should names must be used to order rows and columns? |
A square matrix.
mat <- matrix(1:12, 3, 4) mat2 <- squaretize(mat) matb <- matrix(1:12, 4, 3) colnames(matb) <- LETTERS[1:3] mat2b <- squaretize(matb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.