How to create Multi-Panel plots in R with facet_wrap() and facet_grid()
3,757
Published 2023-07-14
Faceting plots can be very helpful to compare your data over different categories.
It can also help you to get a quick overview of your data across multiple variables if you use a special pivot longer trick.
⏱ Time Stamps ⌚
0:00 - Intro
1:20 - gapminder example
5:09 - facet_wrap arguments
9:35 - facet_grid
13:54 - pivot_longer trick
22:02 - ggarrange
External Links:
www.r-bloggers.com/2018/03/diamonds-and-faceting-a…
www.r-bloggers.acom/2023/02/save-space-in-faceted-…
All Comments (8)
-
Great in-depth video, excellent content.
-
This video is so useful. Thank you so much for sharing :) Appreciate the content and time.
-
Great video! Keep going
-
scale_x_reordered function seems useful
-
14:19 i still fail doing that chart 😅
-
I have a question. How do u change the order of the desplay. The factet grid follows alphabetical order. But i need and special order. For example the order in min 7:09 its Africa, Americas, Asia, Europe. But what if u want Europe first?
-
thanks for the video:) btw dplyr::slice_ functions are nice diamonds %>% slice_sample(n = 5000)