Back to Browse

How to Plot Counts in R: A Step-by-Step Guide

6.5K views
Jul 6, 2020
17:09

🔔 *Subscribe for weekly R videos:* https://www.youtube.com/channel/UCb5aI-GwJm3ZxlwtCsLu78Q?sub_confirmation=1 In this video we look at how to count data in R and plot the results. We look at counts of volcano types, and then a more complex plot with counts of volcano types by region. 🎉 *Enjoyed this video?* Leave a comment below to share what you liked the most! Volcano data from the Tidy Tuesdays R project: https://github.com/rfordatascience/tidytuesday/blob/master/data/2020/2020-05-12/readme.md 0:00 Intro 0:36 Read volcano data 1:17 Look at the volcano data 2:10 Simplify the data 6:37 Plot volcano types 7:55 Improvement: coord_flip() 8:15 Improvement: sort counts with fct_reorder() 10:05 Plot volcano types by region 12:00 Improvement: use scales = "free" 12:42 Improvement: sort counts by region with reorder_within() 15:00 Improvement: add labels 15:30 Improvement: add color with 'fill =' 16:15 Improvement: remove legend with show.legend = FALSE 16:45 Final result!! Code: https://gist.github.com/larsentom/2863378b27859af7cf65125f68c13373

Download

1 formats

Video Formats

360pmp424.9 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How to Plot Counts in R: A Step-by-Step Guide | NatokHD