hgch_scatter | R Documentation |
Creates a scatter chart using Highcharter library.
hgch_scatter(
data,
dic = NULL,
var_cat = NULL,
var_dat = NULL,
var_num = NULL,
...
)
data |
a data frame containing the variables to be plotted. |
dic |
a named list, each element corresponding to a column name in |
var_cat |
the name of the categorical variable in the data frame |
var_dat |
a character vector with the names of date variable. |
var_num |
a character vector with the names of numerical variables. |
... |
additional arguments to be passed to |
a Highcharter scatter chart.
data_draw
data <- ggplot2::diamonds
data <- data |>
dplyr::group_by(clarity) |>
dplyr::summarise(x = sum(x, na.rm = T),
y = sum(carat, na.rm = T))
hgch_scatter(data,
var_num = c("x", "y"),
var_cat = "clarity")
# Custom theme
test_theme <- list(
theme = list(
palette_colors = c("#ffa92a", "lightgreen"),
subtitle_align = "center",
subtitle_family = "Roboto",
subtitle_size = 15,
subtitle_color = "#3b83b8",
subtitle_weight = 700
)
)
hgch_scatter(data,
var_num = c("x", "y"),
var_cat = "clarity",
opts = test_theme,
title = "test title",
subtitle = "test subtitle")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.