Learn R Programming

tidyplots (version 0.3.1)

add_ellipse: Add ellipse

Description

Add ellipse

Usage

add_ellipse(plot, ...)

Value

A tidyplot object.

Arguments

plot

A tidyplot generated with the function tidyplot().

...

Arguments passed on to ggplot2::stat_ellipse().

Examples

Run this code
pca |>
  tidyplot(x = pc1, y = pc2, color = group) |>
  add_data_points() |>
  add_ellipse()

pca |>
  tidyplot(x = pc1, y = pc2, color = group) |>
  add_data_points() |>
  add_ellipse(level = 0.75)

pca |>
  tidyplot(x = pc1, y = pc2, color = group) |>
  add_data_points() |>
  add_ellipse(type = "norm")

Run the code above in your browser using DataLab