Create a Pie plot.

Bior_PiePlot(
  value,
  type,
  label = NULL,
  col = pal_d3("category20", alpha = 0.7)(20),
  title = "",
  text.size = 15,
  plot.title.size = 20,
  label.x = 1.2,
  label.color = "white",
  label.size = 5
)

Arguments

value

A vector of value

type

A vector of type

label

(defaut: label=NULL); A vector of label

col

(defaut: col=pal_d3("category20,",alpha=0.7)(20)); colour for type

title

(defaut: title=""); title for plot

text.size

(defaut: text.size=15); text size

plot.title.size

(defaut: plot.title.size=20); plot.title size

label.x

(defaut: label.x=1.2); geom_text x for label

label.color

(defaut: label.color="white"); geom_text color for label

label.size

(defaut: label.size=5); geom_text size for label

Value

A ggplot object

Examples

# Examples 1
value <- c(0.1,0.2,0.4,0.1,0.3)
type <- c("A (10%)", "B (20%)", "C (40%)", "D (10%)", "E (30%)")
col <- c("#AEC7E8B2", "#FFBB78B2", "#98DF8AB2", "#FF9896B2", "#C5B0D5B2")
Bior_PiePlot(value=value, type=type, col=col, title="Test Bior_pie")


# Examples 2
value <- c(0.1,0.2,0.4,0.1,0.3)
type <- c("A", "B", "C", "D", "E")
label <- c("10%","20%","40%","10%","30%")
col <- c("#AEC7E8B2", "#FFBB78B2", "#98DF8AB2", "#FF9896B2", "#C5B0D5B2")
Bior_PiePlot(value=value, type=type, label=label, col=col, title="Test Bior_pie",
                  label.x=1.2, label.color="white", label.size=5)