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?
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
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.
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
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 😃
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).
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).
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/
You can find materials supporting this vid (and others) at github.com/equitable-equations/youtube.
Extremely helpful, it got me out of a pickle concerning a dataframe with multiple names on it! Thanks for the quality content.
Yay! Glad it helped.
Wow! Thank you very much. Very helpful and well explained :D
thank you this was very straight-forward
thank you so much for your clear explanation!
Fantastic video, thank you for your help.
Thanks for the simple and precise explanation.
Thanks a lot! Good explination!
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?
Quality content and Quality Professor.
Thanks man!
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
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.
Thank you much for taking your time explaining this. 😍😍
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
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.
This is set #3 from Triola's Elementary Stats. You can download it from www.triolastats.com/es13-datasets
very useful video! thank you
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 😃
For sure! I'm constantly googling and checking help files for functions I don't use every day.
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).
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).
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/
@@EquitableEquations Thanks.
This was very helpful
P.S. If you are looking for "messy" data then the billboard data that comes with tidyr is perfect.
That's true! Anyone interested can see how to pivot this one with ?pivot_longer.
Love u men!!!
Love you back!