Learn R Programming

g2r (version 0.1.0)

fig_rug: Rug

Description

Add rugs

Usage

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

Run this code
# NOT RUN {
cars2 <- cars %>% 
  dplyr::bind_rows(cars) %>% 
  dplyr::mutate(
    speed = jitter(speed),
    dist = jitter(dist)
  )

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

# }

Run the code above in your browser using DataLab