find_dims | R Documentation |
This function is used by show_colours()
to find the dimensions of a grid (as close
to square as possible) that will fit all of the entries in a vector of colours.
find_dims(vec, x = NULL)
vec |
(Vector) A vector. |
x |
(Integer) Optionally, the desired width in cells. |
A named numeric vector with 2 entries: x
and y
describing the number of
columns and rows respectively.
## Not run:
find_dims(1:12)
#> x y
#> 3 4
find_dims(1:12, 2)
#> x y
#> 2 6
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.