R/scale_format.R

Defines functions scale_format

Documented in scale_format

#' Change Decimal Places in Axis Labels
#'
#' This function change the number of decimal places on axis labels.
#' This was taken from the following link:
#' https://stackoverflow.com/questions/38722202/how-do-i-change-the-number-of-decimal-places-on-axis-labels-in-ggplot2

#' @param x Character to format
#' @param format How to reformat the labels
#' @return A reformatted character
#'
#' @export

scale_format <- function(x, format = "%.1f") {
  return(sprintf(format, x))
}
sysilviakim/Kmisc documentation built on Jan. 28, 2023, 10:58 a.m.