R/plotAdjust.R

#' @noRd
plotAdjust <-
function (dm)
{

  adj.l <- vector(mode="list")
  adj.l$r.cex <- round(1.05/log(sqrt(nrow(dm))), 1)
  if (nrow(dm) <= 10) {
    adj.l$r.cex <- 0.8
  }
  adj.l$c.cex <- round(1.4/log(sqrt(ncol(dm))), 1)
  if (ncol(dm) <= 10) {
    adj.l$c.cex <- 0.8
  }
  adj.l$pdf.width <- ceiling(sqrt(log(ncol(dm))) * ceiling(sqrt(ncol(dm)))) * 1.8
  adj.l$pdf.height <- ceiling(sqrt(nrow(dm)))
  if(adj.l$pdf.height < 5) {
    adj.l$pdf.height <- 5
  }
  mcc <- max(nchar(colnames(dm)))
  adj.l$labelheight <- round(mcc/100/1.15, 2) / ceiling(adj.l$pdf.height/9)
  mc <- max(nchar(rownames(dm)))
  adj.l$labelwidth <- round(log10(sqrt(mc)) / (sqrt(mc) * mc ^ (-mc / 100)), 2) * 1.2 * adj.l$r.cex
  return(adj.l)

}

Try the PAMhm package in your browser

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

PAMhm documentation built on Sept. 6, 2021, 9:10 a.m.