Faceting

  • filter artist, get characteristics
  • try different combinations of characteristics–which ones seem most related?
  • diagnose error (unquoted ggplot)
  • diagnose error (verb without _)
  • plot with aesthetics
  • plot text instead
  • labs?

Faceting

Faceting

asia_top200 = (
  music_top200
  >> filter(_.continent == "Asia")
)
asia_top200
country position track_name artist streams duration continent
4600 Hong Kong 1 WANNABE ITZY 112648 191.242 Asia
4601 Hong Kong 2 Intentions (feat. Quavo) Justin Bieber 104467 212.867 Asia
4602 Hong Kong 3 Señorita Shawn Mendes 84196 190.960 Asia
... ... ... ... ... ... ... ...
12197 Viet Nam 198 Đưa Nhau Đi Trốn (Chill Version) Đen 20750 241.959 Asia
12198 Viet Nam 199 Hôm Nay Tôi Buồn Phùng Khánh Linh 20580 275.000 Asia
12199 Viet Nam 200 Kick It NCT 127 20495 233.013 Asia

2600 rows × 7 columns

Faceting

(asia_top200
  >> ggplot(aes("position", "streams", color = "country"))
   + geom_point()
)

Faceting

(asia_top200
  >> ggplot(aes("position", "streams", color = "country"))
   + geom_point()
   + facet_wrap('~country')
)

Let’s practice!