extrobe
2/7/2017 - 3:24 PM

Pie Charts

Pie Charts

# Convert bar chart to pie chart
ggplot(mtcars, aes(x = factor(1), fill = am)) +
  geom_bar(position = "fill", width = 1) +
  facet_grid(cyl ~ .) + # Facet it
  coord_polar(theta = "y") #Turn it into a Pie Chart