ComenzarEmpieza gratis

Cleaning up the pie

The pie chart you made in the last plot is good, but it's a little cluttered. Let's clean it up using the ggplot function theme_void() along with giving it a meaningful title with ggtitle(...).

The disease_counts summarized data frame from the last exercise is already loaded for you.

Este ejercicio forma parte del curso

Visualization Best Practices in R

Ver curso

Instrucciones del ejercicio

  • Add theme_void() to the ggplot object to clean up the background.
  • Give the plot the title 'Proportion of diseases'.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

ggplot(disease_counts, aes(x = 1, y = total_cases, fill = disease)) +
	# Use a column geometry.
	geom_col() +
	# Change coordinate system to polar.
	coord_polar(theta = "y") +
	# Clean up the background with theme_void and give it a proper title with ggtitle.
	___ +
	___
Editar y ejecutar código