R/lab.wid.R

Defines functions lab.wid

Documented in lab.wid

#' @title Label Width
#' @description Calculate width of labels for plots.
#'
#' @param labels vector of labels to be used on plots
#' 
#' @importFrom graphics par strwidth
#' @export
#' 
lab.wid <- function(labels) {
  inches_to_lines <- (par("mar") / par("mai"))[1]
  max(strwidth(labels, units = "inches")) * inches_to_lines
}

Try the swfscMisc package in your browser

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

swfscMisc documentation built on Sept. 8, 2023, 5:55 p.m.