layer_lines: Layer lines on a plot.

Description Usage Arguments See Also Examples

View source: R/layer_lines.R

Description

layer_lines differs from layer_paths in that layer_lines sorts the data on the x variable, so the line will always proceed from left to right, whereas layer_paths will draw a line in whatever order appears in the data.

Usage

1

Arguments

vis

Visualisation to modify.

...

Visual properties.

See Also

layer_paths

Examples

1
2
3
4
5
6
mtcars2 <- dplyr::mutate(mtcars, cyl = factor(cyl))
mtcars2 %>% ggvis(~wt, ~mpg, stroke = ~cyl) %>% layer_lines()

# Equivalent to
mtcars2 %>% ggvis(~wt, ~mpg, stroke = ~cyl) %>%
  group_by(cyl) %>% dplyr::arrange(wt) %>% layer_paths()

rpruim/ggvis2 documentation built on May 28, 2019, 2:34 a.m.