fig_rug: Rug

Description Usage Arguments Examples

Description

Add rugs

Usage

1
2
fig_rug(g2, ..., x_axis = TRUE, y_axis = TRUE, opacity = 0.5,
  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).

x_axis, y_axis

Whether to show the ruf on the x and y axis.

opacity

Opacity of individual ticks, passed to asp.

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
 4
 5
 6
 7
 8
 9
10
cars2 <- cars %>% 
  dplyr::bind_rows(cars) %>% 
  dplyr::mutate(
    speed = jitter(speed),
    dist = jitter(dist)
  )

g2(cars2, asp(speed, dist)) %>% 
  fig_point() %>% 
  fig_rug()

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