Tidying Data in R with pivot_longer()

  Рет қаралды 19,424

Equitable Equations

Equitable Equations

Күн бұрын

Пікірлер: 30
@EquitableEquations
@EquitableEquations Жыл бұрын
You can find materials supporting this vid (and others) at github.com/equitable-equations/youtube.
@filipenunesvicente7872
@filipenunesvicente7872 2 жыл бұрын
Extremely helpful, it got me out of a pickle concerning a dataframe with multiple names on it! Thanks for the quality content.
@EquitableEquations
@EquitableEquations 2 жыл бұрын
Yay! Glad it helped.
@ingridtello-lopez1144
@ingridtello-lopez1144 2 ай бұрын
Wow! Thank you very much. Very helpful and well explained :D
@ignvzinho
@ignvzinho 2 жыл бұрын
Thanks for the simple and precise explanation.
@edwardvasquez4288
@edwardvasquez4288 2 жыл бұрын
thank you this was very straight-forward
@Kinglium
@Kinglium 2 жыл бұрын
thank you so much for your clear explanation!
@cjspear
@cjspear Жыл бұрын
Fantastic video, thank you for your help.
@danaetapia9286
@danaetapia9286 Жыл бұрын
Thank you much for taking your time explaining this. 😍😍
@j.knetsch3413
@j.knetsch3413 8 ай бұрын
Thanks a lot! Good explination!
@romanvasiura6705
@romanvasiura6705 Жыл бұрын
Thank you! P.S. definitely it's hard to remember all feature, but at least I'll know where I can find good tips)) and refresh my knowledge... You've done amazing work 😃
@EquitableEquations
@EquitableEquations Жыл бұрын
For sure! I'm constantly googling and checking help files for functions I don't use every day.
@richardmusonda3404
@richardmusonda3404 2 жыл бұрын
Quality content and Quality Professor.
@EquitableEquations
@EquitableEquations 2 жыл бұрын
Thanks man!
@MegaSesamStrasse
@MegaSesamStrasse 3 жыл бұрын
Thanks for the helpful introduction! What can i do if I face following problem: - there are variable spread across multiple columns and - observations are scattered across multiple rows
@EquitableEquations
@EquitableEquations 3 жыл бұрын
Hi! Pivot_longer is your basic tool for dealing with variables spread across multiple columns. The first tool I would consider if each observation used multiple rows would be pivot_wider.
@ronvave2997
@ronvave2997 10 ай бұрын
Thankful for this video. Question. In my data, I've pivot_long columns 3:6, but I also need columns 7:8 in the same dataset as another variable/column and values. How can I do this in the same code chunk?
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
Following up on my last comment: names_pattern = "day_?(.*)_(\\d+)" works! We need that extra '\' in there so that \d+ works (basically we have to escape the \ which works in normal regex by itself but need another in R).
@kevindave277
@kevindave277 3 жыл бұрын
Exceptional video. I would be very glad if you could provide the link for the dataset so I can work with it locally. Much thanks.
@EquitableEquations
@EquitableEquations 3 жыл бұрын
This is set #3 from Triola's Elementary Stats. You can download it from www.triolastats.com/es13-datasets
@dabinjeong9560
@dabinjeong9560 Жыл бұрын
very useful video! thank you
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
Or you could use...names_pattern = "day_?(.*)_(.*)"names_pattern = "day_?(.*)_(.*)" to split your "DAY" column into day and time. using this type of regex. I have not figured out how to get rid of am but is should not be too hard. Just have to fiddle with regex. By the way I prefer to use snake_case which can be done with janitor::clean_names(df). Nice presentation and great source of data. Thanks
@PaulYoung-r8g
@PaulYoung-r8g Жыл бұрын
This was very helpful
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
Andrew, Nice presentation. I could not find the FQA data no matter where I looked. Please provide the link to data when you use external data. I would recommend using data from two sources in these exercises. First, simply the in-house (available in a package or on e of the common r data sets) and second, external data. The external data needs either to be referenced properly. You could also turn into RData that can then be downloaded from for instance Github. The blocks data does not have to be downloaded. It is already available in the "GMLsData" R package. Thanks and keep up the good work! P. S. I attended grad school in the Chicago area (that is a small university in Hyde Park).
@EquitableEquations
@EquitableEquations 2 жыл бұрын
Hi! The pre-loaded data sets are lovely but very well-explored elsewhere, especially the tidyr and dplyr sets, so I chose to avoid them here. You can find FQA data here: universalfqa.org/
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
@@EquitableEquations Thanks.
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
P.S. If you are looking for "messy" data then the billboard data that comes with tidyr is perfect.
@EquitableEquations
@EquitableEquations 2 жыл бұрын
That's true! Anyone interested can see how to pivot this one with ?pivot_longer.
@hugobarrera771
@hugobarrera771 2 жыл бұрын
Love u men!!!
@EquitableEquations
@EquitableEquations 2 жыл бұрын
Love you back!
Tidying data in R with pivot_wider()
12:41
Equitable Equations
Рет қаралды 11 М.
Data wrangling with R in 27 minutes
27:19
Equitable Equations
Рет қаралды 29 М.
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 15 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 13 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 7 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 45 МЛН
Explore your data using R programming
25:39
R Programming 101
Рет қаралды 111 М.
How to purrr
17:46
Equitable Equations
Рет қаралды 11 М.
Learn Machine Learning Like a GENIUS and Not Waste Time
15:03
Infinite Codes
Рет қаралды 184 М.
Graphics in R with ggplot()
18:39
Equitable Equations
Рет қаралды 29 М.
Teaching the tidyverse in 2023 | Mine Çetinkaya-Rundel
37:55
Posit PBC
Рет қаралды 19 М.
Clean your data with R.   R programming for beginners.
27:31
R Programming 101
Рет қаралды 154 М.
R vs Python: Which should you learn for reproducible data science (CC168)
24:33
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 15 МЛН