Nothing
process_get_arrangement <- function(nx, asp_ratio) {
# asp ~ nrow
# |--------------
# 1 |
# ~ncol | nx
# |
ncol_init <- sqrt(nx/asp_ratio)
nrow_init <- nx / ncol_init
# rounding:
nrow_ceiling <- min(ceiling(nrow_init), nx)
ncol_ceiling <- min(ceiling(ncol_init), nx)
# find minimal change
nrow_xtra <- abs(nrow_ceiling - nrow_init) * ncol_init
ncol_xtra <- abs(ncol_ceiling - ncol_init) * nrow_init
# calculaet the other, and subtract 1 when possible
if (nrow_xtra < ncol_xtra) {
nrow <- nrow_ceiling
ncol <- ceiling(nx / nrow)
if ((nrow-1) * ncol >= nx) nrow <- nrow - 1
} else {
ncol <- ncol_ceiling
nrow <- ceiling(nx / ncol)
if ((ncol-1) * nrow >= nx) ncol <- ncol - 1
}
c(nrow=nrow, ncol=ncol)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.