hgch_scatter: Highcharter scatter Chart

hgch_scatterR Documentation

Highcharter scatter Chart

Description

Creates a scatter chart using Highcharter library.

Usage

hgch_scatter(
  data,
  dic = NULL,
  var_cat = NULL,
  var_dat = NULL,
  var_num = NULL,
  ...
)

Arguments

data

a data frame containing the variables to be plotted.

dic

a named list, each element corresponding to a column name in data and defining a set of labels for that column.

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 dsviz_default_opts

Value

a Highcharter scatter chart.

See Also

data_draw

Examples


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")


randommonkey/hgchmagic documentation built on Aug. 23, 2023, 5:56 a.m.