Analyzing Monkeypox Cases in R for Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ค. 2024
  • In this video I analyze 900 confirmed monkeypox cases across the world.
    I generate a barchart with geom_col() and a map with geom_polygon().
    ⏱ Time stamps ⌚
    0:00 - Data source and loading
    2:18 - Exploring the data
    7:28 - Cleaning the names
    8:26 - Cases per country
    11:30 - fct_reorder() countries
    12:30 - fct_lump() other countries
    15:03 - Adding label and color
    16:55 - Mapping the cases
    25:30 - Age distribution
    External links:
    docs.google.com/spreadsheets/...
    github.com/globaldothealth/mo...
    Data source reference:
    Global.health Monkeypox (accessed on 2022-06-04)

ความคิดเห็น • 8

  • @TheDataDigest
    @TheDataDigest  2 ปีที่แล้ว +1

    Data and R Code to the video can be found here (github.com/TheDataDigest/EDA/tree/main/Monkeypox):
    github.com/TheDataDigest/EDA/blob/main/Monkeypox/monkeypox.R

  • @osoriomatucurane9511
    @osoriomatucurane9511 ปีที่แล้ว +1

    Awesome, highly informative tutorial on data cleaning with base R and on building histograms.
    I really appreciate. Also learnt the trick take advantage of history window to recover and reuse the formulas.

    • @TheDataDigest
      @TheDataDigest  ปีที่แล้ว +1

      That is really great to hear. So glad you liked the video and found it helpful and left a comment to let me know. Always puts a smile on my face to get some positive feedback.

  • @user-ro9ex5im2p
    @user-ro9ex5im2p ปีที่แล้ว +1

    This is great! Thanks

  • @gemon39
    @gemon39 2 ปีที่แล้ว +1

    very well explained! thanks a lot

    • @TheDataDigest
      @TheDataDigest  ปีที่แล้ว

      Thank you for leaving a comment. Glad you liked it.

  • @anaascua
    @anaascua ปีที่แล้ว +1

    If i only wanted to fill the predominant bar, and make all the others turn into gray colors.. how can I do that?

    • @TheDataDigest
      @TheDataDigest  ปีที่แล้ว +2

      Hi Ana, thanks for the question. The solution is actually quite easy. However I saw that some of the naming of the online csv file change so please allow me to teach you with the mtcars data set as it is more reproducible:
      mtcars %
      ggplot(mapping = aes(x = mpg, y = rowname)) +
      geom_col(fill = "grey") +
      geom_col(data = mtcars %>% filter(rowname == "Toyota Corolla"),
      mapping = aes(mpg, rowname), fill = "orange")
      What you would do for the monkeypox example is plot everything as before but with fill or color not mapped to a variable within aes() but simply setting it to "grey".
      Then you follow up with a second geom_col() in which you now specify the data set once more but filtered for country == "Brazil" I think has the most cases, or the US etc. And then simply plot over with "orange" or whatever color you like.
      There are other ways to do it with an ifelse or TRUE/FALSE conditions but the example above is straight forward.
      Let me know if you accomplished what you wanted to create :)