stats.Rmddata <- jsonlite::fromJSON("https://echarts.apache.org/examples/data/asset/data/confidence-band.json")
data %>%
dplyr::mutate(
date = as.Date(date, "%Y-%m-%d"),
l = l + value,
u = u - value
) %>%
e_charts(date) %>%
e_line(value, symbol = "none") %>%
e_band(
l, u,
areaStyle = list(list(color = "grey"), list(color = "grey"))
)cor(mtcars) %>%
e_charts() %>%
e_correlations(order = "hclust") %>%
e_tooltip()df <- data.frame(
x = factor(c(1, 2)),
y = c(1, 5),
upper = c(1.1, 5.3),
lower = c(0.8, 4.3)
)
df %>%
e_charts(x) %>%
e_bar(y) %>%
e_error_bar(lower, upper)# data.frame
df <- data.frame(
x = 1:100,
y = rnorm(100, 20, 12)
)
df %>%
e_charts() %>%
e_histogram(y) %>%
e_tooltip()Plot the density on a different Y axis as its range differs much from the that of the histogram.
df %>%
e_charts() %>%
e_histogram(y) %>%
e_density(y, name = "density", areaStyle = list(opacity = .4),
smooth = TRUE, y_index = 1) %>%
e_tooltip()