Potential geometries according to the data
Arguments
- data
A
data.frame
- mapping
List of aesthetic mappings to use with data.
- auto
Return only one geometry.
Examples
library(ggplot2)
# One continuous variable
potential_geoms(
data = iris,
mapping = aes(x = Sepal.Length)
)
#> [1] "histogram" "boxplot" "violin" "density"
# Automatic pick a geom
potential_geoms(
data = iris,
mapping = aes(x = Sepal.Length),
auto = TRUE
)
#> [1] "histogram"
# One discrete variable
potential_geoms(
data = iris,
mapping = aes(x = Species)
)
#> [1] "bar"
# Two continuous variables
potential_geoms(
data = iris,
mapping = aes(x = Sepal.Length, y = Sepal.Width)
)
#> [1] "point" "jitter" "line" "step" "path" "area" "tile"