Analyzing Monkeypox Cases in R for Beginners

Поделиться
HTML-код
  • Опубликовано: 15 июл 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

  • @user-ro9ex5im2p
    @user-ro9ex5im2p Год назад +1

    This is great! Thanks

  • @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.

  • @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 :)