How to Create Bubble Charts in R with geom_point() and scale_size()

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • In this tutorial I show you how to create Bubble Charts in R with geom_point() and ggplot().
    I will explain the different scale_size() function to you and provide an example of mapping cities to the United States based on population size.
    Then I will show you how to make the gapminder data interactive or turn it into an animation.
    ⏱ Time Stamps ⌚
    0:00 - Intro and video overview
    0:59 - scale_size() function arguments
    5:10 - Mapping US cities with usmap()
    10:20 - Interactive bubble chart with plotly()
    17:03 - Animating the gapminder dataset
    External Links:
    www.r-graph-gallery.com/bubbl...
    cran.r-project.org/web/packag...

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

  • @seyisonade1194
    @seyisonade1194 8 หลายเดือนก่อน +1

    I went through some of your videos on the 30Days Charts Challenge...
    They were really GREAT... value adding and top notch.
    Often times,you would give examples using base R and then tidyverse approach_ relatable, rich and real life datasets application.
    Thanks for all you do and represents. Thanks for the time, efforts and large heartedness to put them together for others learning and edification.
    God bless you and yours!

    • @TheDataDigest
      @TheDataDigest  8 หลายเดือนก่อน +1

      Thanks for leaving such a long and lovely comment. I am really glad you liked the videos and found them helpful. I learned R before dplyr was a thing so I often fall back on base R code where I still feel quite comfortable at. Tidyverse/dplyr is usually more efficient and cleaner to program so it is good to learn both I guess :)

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

    Thanks for this informative video. I was eagerly waiting...

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

      Great to hear that my viewers are looking for more videos :)
      I was a bit behind the weekly upload schedule but hopefully get back on track in the future.

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

    Thank you! It is not only beatiful but also very useful.

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

      I appreciate you leaving a comment. I hope to make more useful videos in the future.

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

    Always great contend!
    Thanks for bringing it to us so neatly.

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

      Thanks for the comment. There is of course always more one could talk about and show.
      More examples or use cases and different formatting. But I think the videos should not be over 20 minutes.

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

    how can the size of the bubbles be shown as a 4th variable inside a xyz 3d-plot (each bubble being labeled and colour coded)?

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

      Hi, here I created a 3-dimensional scatterplot:
      twitter.com/DigestData/status/1514508623845728262
      Basically with this code:
      library(NHANES); library(plotly); library(tidyverse)
      df % filter(Age < 19) %>%
      select(Age, Height, Weight, BMI)
      axx %
      plotly::layout(scene = list(xaxis=axx))
      I think there would be options to impact the size of the scatterplot and label the points. Color coding is done by BMI in the example above.