R/n2mfrow.r

Defines functions n2mfrow

n2mfrow <- function(n) {
  # choose plotting array shape for n panels
  if (length(n) != 1) stop(paste("n must be a single number"))
  if (n==1) return(c(1,1))
  if (n==2) return(c(1,2))
  if (n==3) return(c(2,2))
  n1 <- floor(sqrt(n))
  n2 <- ceiling(n/n1)
  c(n1,n2)
}

Try the gradientForest package in your browser

Any scripts or data that you put into this service are public.

gradientForest documentation built on Aug. 24, 2023, 3:03 p.m.