Tidyverse in R - tips & tricks

  Рет қаралды 27,823

Tom Henry - data science with R

Tom Henry - data science with R

Күн бұрын

Пікірлер: 53
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
▶️ Top 7 R packages that are less well known - kzbin.info/www/bejne/jF6opKaGp6yDfsk 🎉 *Subscribe* if you want more videos like this! - kzbin.info/door/b5aI-GwJm3ZxlwtCsLu78Q 😃 *Comment* below to share which tricks you liked the most!!
@s-sugoi835
@s-sugoi835 6 ай бұрын
Thanks, I work in a bank we migrated from SAS to R. This is so helpful.
@tjaeg
@tjaeg 2 жыл бұрын
Please keep on doing these kind of videos!
@spikeydude114
@spikeydude114 2 жыл бұрын
Great video! Very dense with information and straight to the point!
@DM-py7pj
@DM-py7pj 4 жыл бұрын
2:06 what purpose does ungroup() serve in this case?
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Technically it's not necessary! But I have gotten into the habit of 'ungroup()'ing every time after a group_by() because in other contexts - e.g. when the pipe continues with further mutates, summarizes, etc. - forgetting to ungroup() can result in the wrong outcomes. That's because summarize() by default only peels off the last variable in the group_by(). So I have developed the habit of always ungroup()ing after a group_by(), even when it's not necessary!
@DM-py7pj
@DM-py7pj 4 жыл бұрын
@@tomhenry-datasciencewithr6047 Thanks. Great explanations. Subscribed. :-)
@djangoworldwide7925
@djangoworldwide7925 2 жыл бұрын
Super informative and advanced! Thank you. It's hard to find these days advanced tutorials on youtube
@dataslice
@dataslice 4 жыл бұрын
Great tips, Tom! I'm definitely saving this video!
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Awesome! Thank you!
@bridgettsmith7206
@bridgettsmith7206 2 жыл бұрын
Great tips. I appreciate that you have an index of time stamps for the content. I will be more easily able to reference this video later.
@ZuluMonk
@ZuluMonk 4 жыл бұрын
Great tips! Always nice to see better ways of doing things.
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Glad you enjoyed it!
@aliramadan7425
@aliramadan7425 4 жыл бұрын
Thank you. Learned so much!
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Glad it was helpful!
@Wherearethewildthings
@Wherearethewildthings 4 жыл бұрын
Fantastic, Tom! Just subscribed, so helpful
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Glad you found it helpful!
3 жыл бұрын
This is great, so useful. Thanks!
@manohar-kg
@manohar-kg 4 жыл бұрын
Very helpful video... Thanks
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Most welcome :)
@MarcelloNesca
@MarcelloNesca 4 жыл бұрын
Great tips! Always looking for new ways of coding for datasets. Subscribed!
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
More to come!
@nuk3man
@nuk3man 3 жыл бұрын
Great video. Question; in tip nr. 9, what does "\\.?$" do in the first str_replace_all?
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 3 жыл бұрын
Good question! It's a regular expression, and its purpose is to remove an optional '.' at the end of the string of text. For example, ' INC.' or ' CO.' or ' INC' or ' CO' would all be matched and replaced with the empty string (i.e. removed from the text). So 'QUANTAS CO.' (hypothetical) and 'QUANTAS CO' would both become 'QUANTAS' We can break down the "\\.?$" like this: \\. translates into \. - this says to match an actual '.' character. If we didn't have the '\\', it would match _any_ character because '.' is the regular expression code for any character. ? means 'optional' - so the actual '.' may or may not be present - if it is present, it will be matched. $ means the 'end of the string of text'. So putting it together, this means: 'Replace ' ' # a space followed by 'INC' or 'CO' # (INC|CO) followed by an optional '.' # \\.? if all at the end of the string # $ with the empty string # "" ' More info on regular expressions here: r4ds.had.co.nz/strings.html#matching-patterns-with-regular-expressions
@tpflowspecialist
@tpflowspecialist 3 жыл бұрын
Fantastic tydiverse data processing tips. Thank you!
@ecarlosbc
@ecarlosbc 3 жыл бұрын
Great tutorial Sir.!!!!!!!
@timmytesla9655
@timmytesla9655 2 жыл бұрын
This is awesome. Thank you!
@shreyaroraa2234
@shreyaroraa2234 3 жыл бұрын
Very Nice video TOM. Future video idea - Moving from Sql to R common issues and functions comparisons
@QuentinAndres06
@QuentinAndres06 3 жыл бұрын
Tom, you are a boss.
@patricklogan6089
@patricklogan6089 2 жыл бұрын
Good stuff
@ahmed007Jaber
@ahmed007Jaber 3 жыл бұрын
wow! mate love this one. keep it up for tip #18 how would you exclude some columns from this? i actually need to do a similar function to this
@djangoworldwide7925
@djangoworldwide7925 2 жыл бұрын
Just pick other columns
@clono1984
@clono1984 4 жыл бұрын
Hi Tom, do you have the script available for download anywhere? Would love to revisit a few of the tips here. Really like your work. Thanks for sharing! -- Juan
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Sure! I've put a link at the end of the description. Here it is: gist.github.com/larsentom/727da01476ad1fe5c066a53cc784417b
@clono1984
@clono1984 4 жыл бұрын
@@tomhenry-datasciencewithr6047 ahh! can't believe I missed it. Thank you Tom.
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
@@clono1984 Glad you liked the tips! Let me know if you have others to share too!
@melissawong4125
@melissawong4125 2 жыл бұрын
Thanks. Great tips! The github link is no longer working. Is there a new link?
@alihashemian225
@alihashemian225 2 жыл бұрын
I am having trouble accessing the script. Can someone help me?
@heartheart5543
@heartheart5543 3 жыл бұрын
link for the code cannot be accesed: 404
@jaritos675
@jaritos675 4 жыл бұрын
light RStudio theme not acceptable
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Haha! What's your favorite RStudio theme?
@jaritos675
@jaritos675 4 жыл бұрын
@@tomhenry-datasciencewithr6047 cobalt
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 4 жыл бұрын
Nice -- Cobalt is probably my favorite RStudio theme too!
@SuperKrazy2000
@SuperKrazy2000 4 жыл бұрын
Team Light Theme!
@AkashMathur-yc9nu
@AkashMathur-yc9nu 4 жыл бұрын
Power Pack !
@educationulx
@educationulx 3 жыл бұрын
My data(csv) is about historial heights between both genders of different ages . Here , my data contains heights of every years (1986-2019) & Age group > 2 , 8 , 16 , 19 , 22 . Also Male , Female sex . But I just want to select / work with only age 19 (gender male/both) to see their heights between 1986-2019 . How can I do it ? plz let me know .
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 3 жыл бұрын
You can work with something like this: heights %>% filter(year %>% between(1986, 2019)) %>% # year >= 1986, year = 1986 & year % # change to just 'age_group == 19' or 'age_group %in% c(19)' if you want ggplot(aes(year, height, color = sex)) + geom_line() + facet_wrap(~age_group, ncol = 1) this assumes your data looks like this: year | age_group | sex | height 2015 | 16 | Female | 150 etc
@tomhenry-datasciencewithr6047
@tomhenry-datasciencewithr6047 3 жыл бұрын
Then try removing / changing parts of this to see the effects!
@nkuatedivinely7369
@nkuatedivinely7369 3 жыл бұрын
I just started watching some few videos for school purposes, they are great, but u are so fast😅, it will be a great thing if u could speak a little slowly and even repeat some few things, thanks
@Jelieto
@Jelieto 4 жыл бұрын
you sound like daniel ricciardo
@Realtalkvideogames
@Realtalkvideogames 3 жыл бұрын
FLIGHTS DOESNT WORK WITH NEW r
How to download R on Mac
4:31
Tom Henry - data science with R
Рет қаралды 57 М.
Discover 7 Hidden Gems in the R Package Ecosystem
20:18
Tom Henry - data science with R
Рет қаралды 13 М.
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
David Robinson - Ten Tremendous Tricks in the Tidyverse
20:41
Lander Analytics
Рет қаралды 30 М.
Describe and Summarise your data
19:44
R Programming 101
Рет қаралды 59 М.
Using dplyr's group_by function with and without summarize (CC233)
25:54
Riffomonas Project
Рет қаралды 5 М.
Transform Your Data Like a Pro with {tidyr} and Say Goodbye to Messy Data!
13:17
R best practices
16:06
Lyndsie Wszola
Рет қаралды 3,2 М.
Emily Robinson - The Lesser Known Stars of the Tidyverse
18:04
Lander Analytics
Рет қаралды 20 М.
20 R Packages You Should Know
30:42
RichardOnData
Рет қаралды 41 М.
3 Reasons to Use Tidymodels with Julia Silge
1:23:53
R-Ladies Philly
Рет қаралды 4,3 М.