extract_hull: extract_hull

View source: R/extract_hull.R

extract_hullR Documentation

extract_hull

Usage

extract_hull(
  df,
  x,
  y,
  group = NULL,
  drop_outliers = FALSE,
  output = c("df", "sf")
)

Arguments

df

Dataframe to extract shapes from.

x

Numeric variable.

y

Numeric variable.

group

Grouping variable for comparing shape of groups along x-y axes.

drop_outliers

Logical noting to remove outlier percentiles (< 5

\item

outputCharacter – either 'df' or 'sf' – to return regular dataframe for use with 'geom_polygon()', or sf spatial object for use with 'geom_sf()'. Note that spatial output applies a smoothing process to the shapes.

Dataframe of ellipses line shapes along NMDS1 and NMDS2. Extracts the shape of data from dataframes. Originally crafted around multidimensional scaling, but works well with any dataframe. data(iris) iris |> extract_hull(x = "Sepal.Width", y = "Sepal.Length", group = "Species", drop_outliers = TRUE, output = "sf") |> ggplot() + geom_sf(aes(col = Species), fill = NA) + theme_meow()


toddellis/miao documentation built on June 1, 2025, 10:11 p.m.