Learn R Programming

echarts4r (version 0.0.1)

e_lm: Smooth

Description

Aids the eye in seeing patterns in the presence of overplotting.

Usage

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

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

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

Arguments

e

An echarts4r object as returned by e_charts.

formula

formula to pass to lm.

name,

series name.

legend

Whether to plot legend.

symbol

Symbol to use in e_line.

...

Additional arguments to pass to lm, glm, and loess.

Examples

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

# }

Run the code above in your browser using DataLab