This is an overview of what you get playing with the arguments of the pie function. The code is available here. Be carefull, pie charts have several downsides as explained in the dataviz catalog!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# Create Data Prop=c(3,7,9,1,2) # Make the default Pie Plot pie(Prop) # You can also custom the labels: pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E")) # If you give a low value to the "edge" argument, you go from something circular to a shape with edges pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E") , edges=10) # With the radius argument, you choose to zoom in (high values --> big pie) or out (low values --> small pie) pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E") , radius=10) pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E") , radius=0.2) # The clockwise function to decide where you add the first group. If false, starts 90° right, it true, starts on the top of the pie pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E") , clockwise = FALSE) pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E") , clockwise = TRUE) # The density arguments permits to add shading lines, and you can control the angle of this lines with "angle" pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E") , density=10 , angle=c(20,90,30,10,0)) # You can change the border of each area with the classical parameters: pie(Prop , labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E") , border="grey" ) |

Not what you are looking for ? Make a new search !

`[mediatagger]`

## Leave a Reply