Calculate Grouped Summary Statistics in R | group_by & summarize of dplyr Package | Multiple Columns

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ธ.ค. 2024

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

  • @johneagle4384
    @johneagle4384 5 หลายเดือนก่อน

    It has been a while...thank you for the video. I was having some difficulty with group().

  • @zonerazolau-e6s
    @zonerazolau-e6s 5 หลายเดือนก่อน +1

    hello sir, do I need to understand differential equations to understand time series or stochastic modeling?

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน

      Hey, I think you don't need to understand differential equations to grasp the basics of time series or stochastic modeling. However, knowledge of differential equations can be beneficial for more advanced topics and certain models within these fields.

    • @zonerazolau-e6s
      @zonerazolau-e6s 4 หลายเดือนก่อน +1

      @@StatisticsGlobe thank you i will learn them later

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน

      You are very welcome!

  • @ashisranjanudgata5526
    @ashisranjanudgata5526 4 หลายเดือนก่อน +1

    I am getting error in implementation of codes.
    mtcars %>% # Group by one column
    + group_by(cyl) %>%
    + summarize(mean_mpg = mean(mpg))
    Error in mtcars %>% group_by(cyl) %>% summarize(mean_mpg = mean(mpg)) :
    could not find function "%>%"

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน

      Hey, you have to install and load dplyr first. Run this before executing your code:
      install.packages("dplyr")
      library(dplyr)

    • @ashisranjanudgata5526
      @ashisranjanudgata5526 4 หลายเดือนก่อน +1

      @@StatisticsGlobe I have already installed and loaded with library command. Still getting error message, I don't know why?

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน +1

      Ahh, I think you are using the wrong symbol, it should be %>% instead of %>%

  • @sasah177
    @sasah177 4 หลายเดือนก่อน +1

    Thanks, I need to merge rows with string variables, and Sumrize doesn't work for me. Could you help me?

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน

      Hey, could you explain what you mean with "merge rows"?

    • @sasah177
      @sasah177 4 หลายเดือนก่อน +1

      @@StatisticsGlobe I have merged some csv files using dplyr and reduce (full.join), now I have a species column whose characters are listed in columns, in some cases the species are repeated while I want them to be repeated only once, I can Merge the columns with paste (sep=`,`) command
      But I can't for the rows.
      My data looks like starwars dataset and I can also email you an example if I couldn't explain it properly

    • @sasah177
      @sasah177 4 หลายเดือนก่อน +1

      library(dplyr)
      dat %
      dplyr::summarise(Col2 = paste(Col2, collapse = ","))
      print(head(dat.merged))
      ## I have found this but how can I run it for all my columns in once

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน

      Hey, thanks for the further details. Are you looking for this?
      library(dplyr)
      library(tidyr)
      dat %
      summarise(across(everything(),
      ~paste(unique(.),
      collapse = ","),
      .names = "merged_{col}"))
      dat_merged

  • @SidraTulMuntaha-by9ck
    @SidraTulMuntaha-by9ck 5 หลายเดือนก่อน +1

    Hy sir
    Sir I import a excel dataset in Rstudio version 4.3.2 but when I was want to see colnames, it gives me "null"...
    Kindly give me some suggestion who can I solve this problem 🙏

    • @StatisticsGlobe
      @StatisticsGlobe  5 หลายเดือนก่อน

      Hey, could you please share your code? Regards, Joachim

    • @SidraTulMuntaha-by9ck
      @SidraTulMuntaha-by9ck 5 หลายเดือนก่อน +1

      @@StatisticsGlobe
      code of what sir?
      sir can you explain me coding for data splitting in training and testing data?

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน

      The code when you tried to import your data. Regarding your other question, please have a look here: statisticsglobe.com/r-split-data-into-train-and-test-sets

  • @Ragav_326
    @Ragav_326 5 หลายเดือนก่อน +1

    Hii sir, i wanna learn r programming language from scratch. How can I learn?

    • @StatisticsGlobe
      @StatisticsGlobe  4 หลายเดือนก่อน

      Hey, you can find a free introduction here: th-cam.com/video/7mr4Pf2CvSU/w-d-xo.html For a more comprehensive introduction course, please have a look here: statisticsglobe.com/online-course-r-introduction