get_table_layout | R Documentation |
This helper function converts a single-dimensional vector into a two-dimensional tabular matrix.
get_table_layout( n = 1, i = 1:n, origincorner = "topleft", direction = "row", cols = NULL, rows = NULL )
n |
The number of items, if vector is to start from 1 and end at n. Default=1 |
i |
A vector of numbers to be ordered. Default=1:n |
direction |
The direction by which the table should be filled: row, column. Default="row" |
cols |
Number of columns to define the matrix |
rows |
Number of rows to define the matrix |
originalcorner |
The corner from which the matrix should be filled: topleft, bottomleft, topright, bottomright. Default="bottomleft" |
In morphogram, it is used to help structure the tabular distribution layouts. Optional are the origin corner, direction of filling, number columns and/or rows.
A matrix containing the vector.
If only cols is present, rows are calculated automatically to make a matrix. If neither cols or rows are present, cols is set to sqrt of length of vector. The vector is also padded with NA to create empty cells where the cols*rows is greater than the length of the initial vector.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.