Skip to contents

Create a BoxPlot

Usage

v_boxplot(
  vc,
  mapping = NULL,
  data = NULL,
  name = NULL,
  ...,
  outliers = TRUE,
  args_outliers = NULL,
  serie_id = NULL,
  data_id = NULL
)

Arguments

vc

A chart initialized with vchart().

mapping

Default list of aesthetic mappings to use for chart.

data

Default dataset to use for chart. If not already a data.frame, it will be coerced to with as.data.frame.

name

Name for the serie, only used for single serie (no color/fill aesthetic supplied).

...

Arguments passed to JavaScript methods.

outliers

Display or not outliers.

args_outliers

Arguments passed to v_scatter().

data_id, serie_id

ID for the data/serie, can be used to further customize the chart with v_specs().

Value

A vchart() htmlwidget object.

Examples


library(vchartr)

data("penguins", package = "palmerpenguins")

vchart(penguins) %>% 
  v_boxplot(aes(species, flipper_length_mm))
#> Warning: Removed 2 rows containing non-finite outside the scale range
#> (`stat_boxplot()`).
#> Warning: Removed 2 rows containing non-finite outside the scale range
#> (`stat_boxplot()`).
vchart(penguins) %>% v_boxplot(aes(species, flipper_length_mm, color = sex)) #> Warning: Removed 2 rows containing non-finite outside the scale range #> (`stat_boxplot()`). #> Warning: Removed 2 rows containing non-finite outside the scale range #> (`stat_boxplot()`).
data("mpg", package = "ggplot2") vchart(mpg) %>% v_boxplot(aes(as.character(year), hwy))
vchart(mpg) %>% v_boxplot(aes(class, hwy))
vchart(mpg) %>% v_boxplot(aes(class, hwy, color = as.character(year)))