smooth: Smooth

Description Usage Arguments Examples

Description

Add smoothing methods based on x and y and, optionally group aspects.

Usage

1
2
fig_smooth(g2, ..., method = "lm", data = NULL, inherit_asp = TRUE,
  name = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

...

Any option, aesthetic (asp), or animation (Animation).

method

Smoothing method (function) to use, accepts either a character vector, e.g. "lm", "glm", "gam", "loess" or a function, e.g. MASS::rlm or mgcv::gam, base::lm, or base::loess.

data

A data.frame containing data to chart or a list.

inherit_asp

Whether to inherit aspects from g2r.

name

Name of figure, useful to apply functions to specific figures.

Examples

1
2
3
g2(cars, asp(speed, dist)) %>% 
  fig_point() %>% 
  fig_smooth()

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.