knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(ggplot2) library(emphatic)
library(ggplot2) library(emphatic)
test_df <- head(mtcars, 10)
test_df |> hl('skyblue')
test_df |> hl(c('skyblue', 'hotpink', '#445566'))
test_df |> hl(ggplot2::scale_colour_viridis_c(), cols = disp)
The colourscale is calibrated against only the variable disp
, but the colouring
is applied to multiple columns.
test_df |> hl(ggplot2::scale_colour_viridis_c(), cols = disp, scale_apply = mpg:drat)
test_df |> hl(ggplot2::scale_colour_viridis_c(), cols = mpg, show_legend = TRUE) |> hl(ggplot2::scale_colour_viridis_c(), cols = disp, show_legend = TRUE)
The scale is calibrated against all data in the nominated cols
test_df |> hl(ggplot2::scale_colour_viridis_c(), cols = c(wt, gear, carb), show_legend = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.