Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

smooth

Smooth


Description

Plot formulas.

Usage

e_lm(
  e,
  formula,
  name = NULL,
  legend = TRUE,
  symbol = "none",
  smooth = TRUE,
  model_args = list(),
  ...
)

e_glm(
  e,
  formula,
  name = NULL,
  legend = TRUE,
  symbol = "none",
  smooth = TRUE,
  model_args = list(),
  ...
)

e_loess(
  e,
  formula,
  name = NULL,
  legend = TRUE,
  symbol = "none",
  smooth = TRUE,
  x_index = 0,
  y_index = 0,
  model_args = list(),
  ...
)

Arguments

e

An echarts4r object as returned by e_charts or a proxy as returned by echarts4rProxy.

formula

formula to pass to lm.

name

name of the serie.

legend

Whether to add serie to legend.

symbol

Symbol to use in e_line.

smooth

Whether to smooth the line.

model_args

Arguments to pass to the underlying model.

...

Additional arguments to pass to e_line.

x_index

Indexes of x and y axis.

y_index

Indexes of x and y axis.

Examples

iris %>%
  group_by(Species) %>%
  e_charts(Sepal.Length) %>%
  e_scatter(Sepal.Width) %>%
  e_lm(Sepal.Width ~ Sepal.Length) %>%
  e_x_axis(min = 4)

mtcars %>%
  e_charts(disp) %>%
  e_scatter(mpg, qsec) %>%
  e_loess(mpg ~ disp, smooth = TRUE, showSymbol = FALSE)

# timeline
iris %>%
  group_by(Species) %>%
  e_charts(Sepal.Length, timeline = TRUE) %>%
  e_scatter(Sepal.Width) %>%
  e_lm(Sepal.Width ~ Sepal.Length) %>%
  e_x_axis(min = 4, max = 8) %>%
  e_y_axis(max = 5)

echarts4r

Create Interactive Graphs with 'Echarts JavaScript' Version 5

v0.4.0
Apache License (>= 2.0)
Authors
John Coene [aut, cre, cph], Wei Su [ctb], Helgasoft [ctb], Xianying Tan [ctb] (<https://orcid.org/0000-0002-6072-3521>)
Initial release
2021-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.