olink_color_gradient: Olink color scale for continuous ggplots

View source: R/olink_color.R

olink_color_gradientR Documentation

Description

Olink color scale for continuous ggplots

Usage

olink_color_gradient(..., alpha = 1, coloroption = NULL)

Arguments

...

Optional. Additional arguments to pass to ggplot2::scale_color_gradientn()

alpha

transparency (optional)

coloroption

string, one or more of the following: c("red", "orange", "yellow", "green", "teal", "turquoise", "lightblue", "darkblue", "purple", "pink")

Value

No return value, called for side effects

Examples


ggplot2::diamonds |>
  dplyr::filter(
    .data[["x"]] > 5
    & .data[["x"]] < 6
    & .data[["y"]] > 5
    & .data[["y"]] < 6
  ) |>
  dplyr::mutate(
    diff = sqrt(
      x = abs(
        x = .data[["x"]] - .data[["y"]]
      )
    ) * sign(
      x = .data[["x"]] - .data[["y"]]
    )
  ) |>
  ggplot2::ggplot(
    mapping = ggplot2::aes(
      x = .data[["x"]],
      y = .data[["y"]],
      colour = .data[["diff"]]
    )
  ) +
  ggplot2::geom_point() +
  ggplot2::theme_bw() +
  OlinkAnalyze::olink_color_gradient()



OlinkAnalyze documentation built on June 24, 2026, 1:06 a.m.