R/scale_x_ibp_cont.R

Defines functions scale_x_ibp_cont

Documented in scale_x_ibp_cont

#' Title
#'
#' @param n Anzahl von Major Gridlines
#' @param limits Vector mir minimal und maximal Wert
#' @param remove_border_val Derzeit nicht benutzt
#' @param ...
#'
#' @return
#' @export
#'
#' @examples
scale_x_ibp_cont <- function(n = 7, limits = NULL, remove_border_val = FALSE,
                             leading = 2, ...) {
  if (is.null(limits)) {
    ggplot2::scale_x_continuous(breaks = equal_breaks(n = n, s = 0,
                                             remove_border_val = remove_border_val,
                                             leading = leading),
                                limits = equal_breaks_limits(n, leading = leading),
                       expand = c(0, 0), ...)
  } else {
    ggplot2::scale_x_continuous(
      breaks = equal_breaks(
        n = n, s = 0, manual = limits,
        remove_border = remove_border_val
      ),
      expand = c(0, 0), limits = limits, ...
    )
  }
}
SebaStad/ggIBPplot documentation built on Nov. 17, 2020, 9:24 a.m.