Splitting columns in R with the separate() command

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

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

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

    You can find materials supporting this vid (and others) at github.com/equitable-equations/youtube.

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 9 месяцев назад

    separate has been replaced with separate_wider_(delim, position or regex). It is a great function.

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

    Thank you so much for teaching this lesson!

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

    Cool, very useful command! Thank you so much!

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

    What an amazing channel. Thank you for your help!

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

    Thank you for a wonderful tutorial! I'm working with large dataset, and I can see the results I'm looking for in the console by doing head() but its not applying to my actual dataset when i do View(). Im not sure what im doing wrong here. Any advice?

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

      Hmm, you should see similar things with head and View, assuming you pass them each the same data set. My guess is that your inputs aren't exactly the same. Good luck!

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

    what if a column contains a vector, instead of Johny Smith you have c(Johny, Smith) and instead of Mary Smith you have c(Mary, Smith). How do you separate them? thanks

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

      Hi! The hoist() command is probably what you're looking for.

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

    how do you separate the values of a column where no delimiter is given?

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

      There has to be some sort of delimiter in order for this task to make sense, right? Either in the data or user-specified.

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

      @@EquitableEquations Thanks, I've figured it out. I used, sep = 1 to split the values of a column sexage into 2 new columns sex and age..

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

    Wonderfully thaks!!!

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

    Hello, Thank you for the video, this was very explanatory. But what do we do if we want to split the observations in Multiple columns in our dataset into multiple columns, what do we do? I tried the separate function, but this didn't work

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

      Hi! The separate() command specifically targets a single column, probably because a lot could go wrong if you were to split multiple columns at once. While you could iterate the process, I'd be nervous about doing so.

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

    Thanks for the video

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

    Professor. It is a great content. I have a large dataset of tick level data. So, each day i have thousands of transactions. Is it possible to split daily transactions data into three buckets- namely low, medium, and large transactions. Say there are 30k transactions. I want first 10k as low, the middle 10k as medium, and the rest as large? Thank You.

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

      Hi! Either cut() or one of the slice_*() functions should do the job. I have a vid on the latter: ruclips.net/video/7bqtmMfDg-4/видео.html

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

    Wonderful

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

    Thank you!

  • @tmitra001
    @tmitra001 5 месяцев назад

    hi it is not saving in smits data after you split! right?

  • @어쩔티비-k3w
    @어쩔티비-k3w 2 года назад

    I have some question .
    This is my code and I think I did same as you, but it doesnt work.
    separate(Graduation_1,
    col = date,
    into = c("year", "month", "day"))

    Error code :
    Must extract column with a single valid subscript.
    x Subscript `var` has the wrong type `function`.
    i It must be numeric or character.
    Run `rlang::last_error()` to see where the error occurred.

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

      Hi! For specific questions like this, I recommend the R4DS learning community. www.rfordatasci.com/