Learn R Programming

echarts4r (version 0.2.0)

e_lm: Smooth

Description

Plot formulas.

Usage

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

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

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

Arguments

e

An echarts4r object as returned by e_charts.

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.

...

Additional arguments to pass to e_line.

x_index

Indexes of x and y axis.

y_index

Indexes of x and y axis.

Examples

Run this code
# NOT RUN {
mtcars %>% 
  e_charts(mpg) %>% 
  e_scatter(qsec, symbol_size = 10) %>% 
  e_lm(qsec ~ mpg, name = "y = ax + b")
  
mtcars %>% 
  e_charts(disp) %>% 
  e_scatter(mpg, qsec) %>% 
  e_loess(mpg ~ disp)
  
CO2 %>% 
  e_charts(conc) %>% 
  e_scatter(uptake, symbol_size = 10) %>% 
  e_glm(uptake ~ conc, name = "GLM")

# }

Run the code above in your browser using DataLab