Learn R Programming

echarts4r (version 0.0.1)

e_histogram: Histogram & Density

Description

Add a histogram or density plots.

Usage

e_histogram(e, serie, breaks = "Sturges", name = NULL, legend = TRUE,
  bar.width = "99%", y.index = 0, x.index = 0, ...)

e_density(e, serie, breaks = "Sturges", name = NULL, legend = TRUE, x.index = 0, y.index = 0, ...)

Arguments

e

An echarts4r object as returned by e_charts.

serie

Column name of serie to plot.

breaks

Passed to hist.

name

name of the serie.

legend

Whether to add serie to legend.

bar.width

Width of bars.

y.index

Indexes of x and y axis.

x.index

Indexes of x and y axis.

...

Any other option to pass, check See Also section.

Examples

Run this code
# NOT RUN {
mtcars %>% 
  e_charts() %>% 
  e_histogram(mpg, name = "histogram") %>% 
  e_density(mpg, fill = TRUE, smooth = TRUE, name = "density", y.index = 1) %>% 
  e_tooltip(trigger = "axis")

# }

Run the code above in your browser using DataLab