Skip to contents

This function creates a ggplot2 geom for drawing diamond plots, which are used to visualize lattice structures in data. This is useful especially for visualization of rules and its ancestors.

Usage

geom_diamond(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  na.rm = FALSE,
  linetype = "solid",
  nudge_x = 0,
  nudge_y = 0.125,
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

mapping

Aesthetic mappings, usually created with aes().

data

A data frame containing the data to be plotted.

stat

The statistical transformation to use on the data, default is "identity".

position

Position adjustment, default is "identity".

na.rm

A logical value indicating whether to remove missing values.

linetype

The type of line to use for the edges, default is "solid".

nudge_x

Horizontal nudge for the x-coordinates of the labels.

nudge_y

Vertical nudge for the y-coordinates of the labels.

show.legend

A logical value indicating whether to show the legend.

inherit.aes

A logical value indicating whether to inherit aesthetics from the plot.

...

Other arguments passed to the layer.

Value

A ggplot2 layer object that can be added to a ggplot.

Details

The diamonds represent items in the lattice, and edges represent an inclusion relationship between them.