R/pkLineToInch.r

Defines functions lineToInch

Documented in lineToInch

# function to convert number of lines to inches
# 'Convert lines to inches'

#' Convert lines to inches
#'
#' Function to convert device lines to inches
#' 
#' @param x Number of lines
#' @param cm Return centimeter instead (logical)
#' @return Number of inches 
#' @export
lineToInch <- function(x=1, cm=F){
  inches <- par('cin')[2] * par('cex') * par('lheight') * x
  return(ifelse(cm, inches*2.54, inches))
}



#' @rdname lineToInch
#' @export
pkLineToInch <- lineToInch
kraaijenbrink/pkrf documentation built on July 4, 2023, 10:16 p.m.