dplyr: gather and spread

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

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

  • @silfalqueto
    @silfalqueto 3 года назад +6

    thank you! I was struggling with gather
    until this video.

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

      Glad it helped!

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

    Hello from Brazil, thanks for the video!

  • @StatistikinDD
    @StatistikinDD 4 года назад +1

    Aren't these tidyr functions? Newer versions, probably more intuitive, are called pivot_longer() and pivot_wider().
    It is nice though how well the tidyverse packages (like dplyr, tidyr, ggplot2, stringr, readr, and others) work together.

  • @aephidayatuloh
    @aephidayatuloh 2 года назад

    The gather()/pivot_longer() and spread()/pivot_wider() are from {tidyr} package, not dplyr.

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

    Thank you.

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

    thankyou so much!

  • @sbdavid123
    @sbdavid123 5 лет назад +1

    Your missing a link to the next video in your playlist here!

    • @DataDaft
      @DataDaft  5 лет назад +1

      Thanks! I added the end screen link.

  • @Radikal9k86
    @Radikal9k86 2 года назад

    Thanks, nice explanation

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

    Thank you, DD.

  • @sanjaisrao484
    @sanjaisrao484 2 года назад

    Thanks

  • @yobruh6029
    @yobruh6029 4 года назад

    When i use the spread function, some of my column repeat its values and causes some values in the new column to be NA. How do i fix this?

    • @DataDaft
      @DataDaft  4 года назад

      I couldn't be sure without looking at the data, but spreading data will introduce NA values in the columns if there isn't a separate row in the long data set for every combination of the levels of the column you are spreading and the columns you aren't spreading. It is not something you can necessarily fix because it means your data set just doesn't contain that information, but you can include the optional argument fill = "fill value" to fill those NAs with 0 or something other than NA in your spread call.

  • @epistemicompute
    @epistemicompute 4 года назад

    Is this now called pivot_longer() and pivot_wider()