Parameters to customize heatmaps in robotables and robomaps.
Arguments
- maxcolor, midcolor, mincolor, na_color
Characters. Colors used for heatmap color range. Must be a hexadecimal colors or a valid css colors.
- maxvalue, midvalue, minvalue
Numerics. Optional. Numeric breakpoints where
maxcolor
,midcolor
andmincolor
are set at. Any values falling outside of this range will have the nearest corresponding color. If not provided,robotable()
calculates the values from the data. Currently only support heatmaps across all numeric columns in the givenrobotable()
.
Examples
# Use `set_heatmap()` to specify any the colors are value breaks used in heatmaps.
d <- roboplotr::energiantuonti |>
dplyr::filter(Alue %in% c("Ruotsi","USA")) |>
tidyr::unite(Tiedot, Alue, Suunta, sep = ", ") |>
dplyr::arrange(Tiedot, time) |>
tidyr::pivot_wider(names_from = Tiedot) |>
dplyr::mutate(dplyr::across(where(is.numeric), ~ tidyr::replace_na(.x, 0))) |>
dplyr::arrange(time)
# No specifications uses the ends of the default trace colors set with
# `set_roboplot_options()` and bases the numeric breakpoints on the data.
d |> robotable(heatmap = set_heatmap())
# You can specify any of the parameters separately, and `robotable()` fills in the rest.
d |>
robotable(heatmap = set_heatmap(
midcolor = "white",
mincolor = "lightblue",
midvalue = 75
))