gg_pie | R Documentation |
Pie with ggplot2
gg_pie( data.tb, y.c = "", color.c = "", title.c = "", palette.vc = "Set1", label.c = c("none", "value", "percent")[1], geom_text.ls = list(lab.i = 7, legend_title.i = 16, legend_text.i = 14, title.i = 16), figure.c = c("interactive", "my_pie.pdf", "none")[1] )
data.tb |
Tibble (or data frame) containing the information |
y.c |
Character: name of the column with the factor to be displayed; alternatively, name of the column with the counts (in this case set the name of the column with the names of the factor levels with the 'color.c' argument) |
color.c |
Character: optional name of the column with the names of the factor levels |
title.c |
Character: plot title |
palette.vc |
Character: either the name of an RColorBrewer palette (default: 'Set1'; 'Paired' can be useful for parallel plotting) or a vector manually defining the colors |
label.c |
Character: (relative) counts to be displayed on the pie; either 'none' (default), 'value' or 'percent' |
geom_text.ls |
List of sizes for lab.i (default 7), legend_title.i (16), legend_text.i (14), and title.i (16) |
figure.c |
Character: either 'interactive' for interactive display, 'my_pie.pdf' for figure saving (only the extension matters), or 'none' to prevent plotting |
invisible ggplot2 object
sacurine.eset <- phenomis::reading(system.file("extdata/W4M00001_Sacurine-statistics", package = "phenomis")) sacurine_pda.df <- Biobase::pData(sacurine.eset) sacurine_pda.df <- sacurine_pda.df[!grepl("QC", rownames(sacurine_pda.df)), ] gg_pie(sacurine_pda.df, y.c = "gender", label.c = "value")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.