R/relabel_y_axis.R

Defines functions relabel_y_axis

Documented in relabel_y_axis

#' Relabel the Y-Axis of a Dot-Whisker Plot
#'
#' \code{relabel_y_axis} DEPRECATED. A convenience function for relabeling the predictors on the y-axis of a dot-whisker plot created by \code{\link[dotwhisker]{dwplot}}.  It is deprecated; use \code{\link[dotwhisker]{relabel_predictors}} instead.
#'
#' @param x A vector of labels for predictors, listed from top to bottom
#'
#' @seealso \code{\link[dotwhisker]{relabel_predictors}} to relabel predictors on the y-axis of a dot-whisker plot or in a tidy data.frame
#'
#'
#' @export

relabel_y_axis <- function(x) {
    scale_y_continuous(breaks = length(x):1, labels = x)
}

Try the dotwhisker package in your browser

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

dotwhisker documentation built on Sept. 5, 2021, 5:08 p.m.