View source: R/pie_addimages.R
pie_addimages | R Documentation |
This function allows to easily add some figures to you pie chart, taking information
from the output of the pie_bake
function.
You can also customize the chart by specifying the colors of borders and labels, the
title of the pie chart and where (and if) you want to print the percentages
for each group.
pie_addimages(
mypie,
imglist,
perc = "no",
lbl_col = "black",
border_col = "black",
title = ""
)
mypie |
A ggplot object. The output from |
imglist |
A list of objects returned by and |
perc |
You can choose among:
|
lbl_col |
A string containing the chosen color for the labels, default is
|
border_col |
A string containing the chosen color for the border of the pie
chart, default is |
title |
A string. If you want, you can specify the title of the graph. |
A ggplot object.
Please note that this function is based on the imagepie
function.
img5 <- jpeg::readJPEG(system.file("img", "pie.jpeg", package = "tastypie"))
imgs2 <- list(img5, img5, img5)
df2 <- data.frame(
c("A", "B", "C"),
c(300, 250, 600)
)
mypie2 <- pie_bake(df2, template = "rainbow1")
pie_addimages(
mypie = mypie2,
imglist = imgs2,
perc = "right",
lbl_col = "darkcyan",
border_col = "orangered",
title = "Example"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.