Histograms in R with ggplot and geom_histogram() [R-Graph Gallery Tutorial]

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024

Комментарии • 15

  • @m3ick
    @m3ick 3 года назад +3

    Nice tutorial. Hope you get more views :)

    • @TheDataDigest
      @TheDataDigest  3 года назад

      Thank you very much, I hope so too ;)
      This is currently my 4th best performing video. Looking forward at getting better to deliver helpful content about R in the future.

  •  2 года назад +1

    Really useful. Thanks!

  • @NatashaKasher
    @NatashaKasher 3 года назад +2

    Hi, thanks for the tutorial, I personally find the background music distractive, but maybe it's just me.

    • @TheDataDigest
      @TheDataDigest  3 года назад +1

      Hi Natasha, good question and thanks for your feedback. Maybe I should do the next few tutorials without music and see how well they do. If people want to listen to music in the background they can follow their own preferences anyway.

  • @tajamulislamshah8494
    @tajamulislamshah8494 2 года назад +1

    Kindly show how different variables can be put in one graph. Like, I have mean value of four soil properties along with 13 treatments. I wanna put these 4 soil properties along with treatments in a single graph but I don't know how?

    • @TheDataDigest
      @TheDataDigest  2 года назад +1

      I can probably achieve that with the facet_wrap() or facet_grid() functions. I suggest you post your question at *stackoverflow*. Give some example data and some graphs you already created and ask there how to combine them. Usually you will get good answers there within a few days.

    • @tajamulislamshah8494
      @tajamulislamshah8494 2 года назад +1

      @@TheDataDigest Thanks

  • @jtotherock7244
    @jtotherock7244 Год назад

    Hello, how can I create intervals for the age like you have, 20-29. 30-39, 40-49, in the table itself? When I import a txt document I've made with the intervals in one category, they are interpreted as Character data and not double data, so I can't make histograms essentially. How have you done it?

    • @TheDataDigest
      @TheDataDigest  Год назад

      Hi there, thanks for asking the question. geom_histogram() or geom_density() indeed only works for continuous numeric data. In the example at 9:00 minutes I am using geom_bar() and after 10:00 I am using geom_col(). Depending on the data you can use those. Maybe you have to turn your character age-ranges into a factor with ordered levels first.
      If you still need help feel free to email me the code and the data (question[at]thedatadigest[dot]email)

    • @jtotherock7244
      @jtotherock7244 Год назад

      @@TheDataDigest Hi, thanks for your reply. I would need a histogram. I believe I need the range of values like you have, but for height. I need it in a table and the column name would essentially be Heights. Then I'd have the frequency for females and males. What could be your email, I may be able to show you what I have so far? Thank you

    • @TheDataDigest
      @TheDataDigest  Год назад

      @@jtotherock7244 I posted my mail address above. Just replace the at/dot. You can create something that looks like a histogram with geom_col() or geom_bar() by removing the space between bars. The frequency will come from counting the instances within your interval. Anyway I am sure I can help you. Feel free to include screenshots or pngs to show what the final chart should look like.

    • @jtotherock7244
      @jtotherock7244 Год назад

      @@TheDataDigest I see what You are saying, unfortunately I would still need a histogram. Also I cannot quite understand what the email is? I've just tried to set characters to factors but I believe It still does not work. I get an error that I need continuous x-values =(.

    • @TheDataDigest
      @TheDataDigest  Год назад

      @@jtotherock7244 Please send your code and some example data to:
      question@thedatadigest.email
      Sometimes online people post their mail addresses with replaced @-sigh [at] and no "." [dot]. In order not to get spam mails from bots scraping websites.