knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(ggplot2) library(emphatic)
library(ggplot2) library(emphatic)
Use {emphatic}
to highlight the mtcars
dataset where:
gear
or carb
columnshotpink
mtcars
mtcars
{emphatic}
mtcars |> hl('skyblue')
mtcars |> hl('skyblue', rows = cyl %in% c(6, 8))
mpg
rating using ggplot2::scale_colour_viridis_c()
mtcars |> hl(ggplot2::scale_colour_viridis_c(), rows = cyl %in% c(6, 8), cols = mpg)
gear
and carb
mtcars |> hl(ggplot2::scale_colour_viridis_c(), rows = cyl %in% c(6, 8), cols = mpg, scale_apply = mpg:am)
mtcars |> hl(ggplot2::scale_colour_viridis_c(), rows = cyl %in% c(6, 8), cols = mpg, scale_apply = mpg:am) |> hl('hotpink', rows = mpg == max(mpg))
mtcars |> hl(ggplot2::scale_colour_viridis_c(), rows = cyl %in% c(6, 8), cols = mpg, scale_apply = mpg:am) |> hl('hotpink', rows = mpg == max(mpg)) |> hl_adjust(text_contrast = 0.25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.