bezier_to_polygon: Transform bezier dataframe to dataframe with path coordinates

View source: R/bezier_coords.R

bezier_to_polygonR Documentation

Transform bezier dataframe to dataframe with path coordinates

Description

Transform bezier dataframe to dataframe with path coordinates

Usage

bezier_to_polygon(df_benjamini_leaf, ..., n = 100)

Arguments

df_benjamini_leaf

Dataframe returned by benjamini_leaf()

...

grouping variables in df_benjamini_leaf that will be kept in the transformation.

n

number of points per bezier

Value

Dataframe with the coordinates of the bezier curve interpolations.

Examples

df_coords <- benjamini_leaf() %>%
  tidyr::unite(b, i_part, element, remove = FALSE) %>%
  bezier_to_polygon(b, i_part, element)
df_coords
df_coords %>%
  ggplot2::ggplot(ggplot2::aes(x = x, y = y, group = element, fill = element)) +
  ggplot2::geom_polygon()

urswilke/ggbenjamini documentation built on Sept. 13, 2023, 10:46 p.m.