geoms: Potential geometries according to the data

geomsR Documentation

Potential geometries according to the data

Description

From the data and variable used in aesthetics, decide which geometry can be used and which one is used by default.

Usage

potential_geoms(data, mapping, auto = FALSE)

potential_geoms_ref()

Arguments

data

A data.frame

mapping

List of aesthetic mappings to use with data.

auto

Return only one geometry.

Value

A character vector

Examples


library(ggplot2)

# One continuous variable
potential_geoms(
  data = iris,
  mapping = aes(x = Sepal.Length)
)

# Automatic pick a geom
potential_geoms(
  data = iris,
  mapping = aes(x = Sepal.Length),
  auto = TRUE
)

# One discrete variable
potential_geoms(
  data = iris,
  mapping = aes(x = Species)
)

# Two continuous variables
potential_geoms(
  data = iris,
  mapping = aes(x = Sepal.Length, y = Sepal.Width)
)
# Reference used by esquisse to select available geoms
# and decide which one to use by default
potential_geoms_ref()

esquisse documentation built on Sept. 18, 2024, 5:09 p.m.