Bake.G Bake.G - 3 days ago 4
R Question

Pie Charts - R - Method to Output Several Pie Charts at Once

I'm working on pie charts in R. I need to create about 8 pie charts with the aim of lining them up all together in order to tell a story.

Is there a way of plotting 8 pie charts at once so it appears on the plots together?

The obvious alternative is run each pie chart once at a time and combine them that way.
Thanks

Answer

Use par

par(mfrow=c(4,2))
a <- c(10, 15,20, 25, 3)
b <- c("A", "B", "C", "D", "E")
pie(a, labels = b)
pie(a, labels = b)
pie(a, labels = b)
pie(a, labels = b)
pie(a, labels = b)
pie(a, labels = b)
pie(a, labels = b)
pie(a, labels = b)