library(ggpie)
library(ggplot2)
data(diamonds)
# inner circle label, outer circle label and in pie plot
ggnestedpie(
data = diamonds, group_key = c("cut", "color"), count_type = "full",
inner_label_info = "all", inner_label_split = NULL,
outer_label_type = "circle", outer_label_pos = "in", outer_label_info = "all"
)
# inner circle label, outer circle label and in pie plot, remove fraction below 1 of inner pie
ggnestedpie(
data = diamonds, group_key = c("cut", "color"), count_type = "full",
inner_label_info = "all", inner_label_split = NULL,
inner_label_threshold = 1, inner_label_size = 3,
outer_label_type = "circle", outer_label_pos = "in", outer_label_info = "all"
)
# inner circle label, outer circle label and out of pie plot
ggnestedpie(
data = diamonds, group_key = c("cut", "color"), count_type = "full",
inner_label_info = "all", inner_label_split = NULL,
outer_label_type = "circle", outer_label_pos = "out", outer_label_info = "all"
)
# inner circle label and no split, outer horizon label and out of pie plot,
# remove fraction below 1 of inner pie
ggnestedpie(
data = diamonds, group_key = c("cut", "color"), count_type = "full",
inner_label_info = "all", inner_label_split = NULL,
inner_label_threshold = 1, inner_label_size = 3,
outer_label_type = "horizon", outer_label_pos = "out", outer_label_info = "all"
)
# inner circle label and no split, outer horizon label and in pie plot,
# remove fraction below 1 of inner pie,
# adjust fraction below 10 to out of pie of outer pie plot.
ggnestedpie(
data = diamonds, group_key = c("cut", "color"), count_type = "full",
inner_label_info = "all", inner_label_split = NULL,
inner_label_threshold = 1, inner_label_size = 3,
outer_label_type = "horizon", outer_label_pos = "in",
outer_label_info = "all", outer_label_threshold = 10
)
# create blank between inner and outer pie
ggnestedpie(
data = diamonds, group_key = c("cut", "color"), count_type = "full", r0 = 0.5, r1 = 1.5, r2 = 2.6,
inner_label_info = "all", inner_label_split = NULL,
inner_label_threshold = 1, inner_label_size = 3,
outer_label_type = "horizon", outer_label_pos = "in",
outer_label_info = "all", outer_label_threshold = 10
)
Run the code above in your browser using DataLab