There are two arguments absolutely needed in aes() mappings:
cat A discrete categories vector.
val A numerical values vector.
geom_slice(
mapping = NULL,
data = NULL,
show.legend = NA,
na.rm = FALSE,
inherit.aes = TRUE,
slice_angle = 180,
init_angle = 0,
x0 = 0,
y0 = 0,
radius = 1,
color = "black",
alpha = 1,
linewidth = 0.5,
slice_position = NA,
labels_with_tick = FALSE,
labels_family = "",
labels_size = 5,
labels_col = "black",
labels_hjust = 0.5,
labels_vjust = 0.5,
labels_fontface = "plain",
labels_lineheight = 1.2,
tick_lwd = 1,
...
)A ggplot2 layer.
Set of aesthetic mappings created by aes() or
aes_(). If specified and inherit.aes = TRUE (the
default), it is combined with the default mapping at the top level of the
plot. You must supply mapping if there is no plot mapping.
to be displayed in this layer
logical. Should this layer be included in the legends?
NA, the default, includes if any aesthetics are mapped.
FALSE never includes, and TRUE always includes.
It can also be a named logical vector to finely select the aesthetics to
display.
If FALSE, the default, missing values are removed with
a warning. If TRUE, missing values are silently removed.
If FALSE, overrides the default aesthetics,
rather than combining with them.
Pie slice angle
Starting angle
Init position x
Init position y
Driving circle radius
Plot border colour
Filling colour transparency [0,1]
Plot border size
Pie slice position
TRUE if we want tick when labelling categories
Labels font family
Labels font size
Labels colour
Labels horizontal adjusting
Labels vertical adjusting
Labels font face
Labels line height
Ticks Size
other arguments passed on to layer().
my_df <- data.frame(cat = c("Apple", "Banana", "Pineapple"), val = c(2.65, 4.5, 6.25))
my_df |>
ggplot2::ggplot() +
geom_pie(ggplot2::aes(cat = cat, val = val)) +
ggplot2::coord_equal()
Run the code above in your browser using DataLab