R/add_ridge.R

Defines functions add_ridge

Documented in add_ridge

#' Add a ridge to an scplot
#'
#' @inheritParams .inherit_scplot
#' @return An object of class `scplot` (see[scplot()]) with changed element
#'   `ridges`.
#' @export
add_ridge <- function(object,
                      color = "grey98",
                      variable = ".dvar") {

  new_ridge <- list(
    variable = variable,
    colour = color
  )

  object$ridges <- c(object$ridges, list(new_ridge))
  object
}

Try the scplot package in your browser

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

scplot documentation built on April 12, 2025, 2:26 a.m.