knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(g2r)
Planes are like facets in ggplot2. You use plane_wrap
and specify the planes, unname using the planes
function.
iris %>% g2(asp(Petal.Length, Petal.Width, color = Species)) %>% fig_point() %>% plane_wrap(planes(Species))
There are different types of planes, the default is list
.
g2(temp, asp(city, temp, color = city)) %>% fig_interval() %>% plane_wrap(planes(month), type = "circle")
g2(temp, asp(month, temp, color = city)) %>% fig_interval() %>% plane_wrap(planes(city), type = "mirror")
iris %>% g2(asp(Petal.Length, Petal.Width, color = Species)) %>% fig_point() %>% plane_wrap(planes(Species), type = "tree")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.