Day 14 of viz with me

Data viz Beginner ggplot exercise boxplot geom_boxplot DataViz Challenge

An exercise with a new geom for boxplots.

Soundarya Soundararajan true
2024-10-14

Congratulations! You’ve completed two weeks of the “Viz with Me” series. Thanks for following along so far. We have just two more weeks to go!

Goals for today: Since you now know the basics of plot building, today I’ll challenge you with an exercise using a new geom.

Exercise

Problem situation

You need to visualize the body mass of penguins by species category. The goal is to identify which penguin species has the highest median body mass. We won’t calculate the median directly; instead, we’ll do this using visualizations—specifically, box plots.

Identify the appropriate geom

Which geom function is used to create boxplots in ggplot2?

Pipe the data to ggplot2

Use the %>% operator to pass the penguins data to ggplot(), and add the correct geom to generate the boxplot.

Style the plot

Use labs() and theme() to improve the labeling and appearance of the plot.

Jump to tomorrow for the solution here.

Challenge Photo by Pixabay

Citation

For attribution, please cite this work as

Soundararajan (2024, Oct. 14). My R Space: Day 14 of viz with me. Retrieved from https://github.com/soundarya24/SoundBlog/posts/2024-10-14-day-14-of-viz-with-me/

BibTeX citation

@misc{soundararajan2024day,
  author = {Soundararajan, Soundarya},
  title = {My R Space: Day 14 of viz with me},
  url = {https://github.com/soundarya24/SoundBlog/posts/2024-10-14-day-14-of-viz-with-me/},
  year = {2024}
}