e_bar | R Documentation |
Add bar serie.
e_bar(
e,
serie,
bind,
name = NULL,
legend = TRUE,
y_index = 0,
x_index = 0,
coord_system = "cartesian2d",
...
)
e_bar_(
e,
serie,
bind = NULL,
name = NULL,
legend = TRUE,
y_index = 0,
x_index = 0,
coord_system = "cartesian2d",
...
)
e |
An |
serie |
Column name of serie to plot. |
bind |
Binding between datasets, namely for use of |
name |
name of the serie. |
legend |
Whether to add serie to legend. |
x_index, y_index |
Indexes of x and y axis. |
coord_system |
Coordinate system to plot against. |
... |
Any other option to pass, check See Also section. |
The bar serie expects the data on the x axis to be
categorical
in R this means a factor
or
character
. If the data on the x axis is numeric
everything should work well in most cases but strange
behaviour may be observed.
library(dplyr)
mtcars |>
tibble::rownames_to_column("model") |>
mutate(total = mpg + qsec) |>
arrange(desc(total)) |>
e_charts(model) |>
e_bar(mpg, stack = "grp") |>
e_bar(qsec, stack = "grp")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.