Thank you very much for the great tutorial! By the way, slice function has new features. This is from the dplyr version history: slice() gains a new set of helpers: slice_head() and slice_tail() select the first and last rows, like head() and tail(), but return n rows per group. slice_sample() randomly selects rows, taking over from sample_frac() and sample_n(). slice_min() and slice_max() select the rows with the minimum or maximum values of a variable, taking over from the confusing top_n().
Really useful pair of tutorials - I'm an experienced R user trying to get my head around the dplyr way of thinking, and these were helpful. Thanks again,
Data School Can I give a slight criticism??? SPACE after every %>% and not lines over 80 characters with three or four %>% it is driving me CRAZY! I know alt+enter is a nice shortcut but ctl-shift-P also works. Smiles
Marc Telesha Ha! I used nicer formatting in my previous dplyr tutorial, but this time, I decided to write my tutorial code the way I write my real code :) However, I'll consider changing back for my next tutorial!
Data School Thank you if you do :) Even if you don't it is a really good run through of dplyr. It will be intresting to see if Juypter (AKA iPython) Notebook might work better for your tutorials?
Marc Telesha Definitely worth considering! I teach some of my data science classes using IPython notebook, but up to now have not used them for R code. Thanks for the idea!
you prolly dont give a damn but does any of you know of a way to log back into an Instagram account?? I stupidly forgot my account password. I would appreciate any tips you can give me
@Shawn Koda thanks so much for your reply. I got to the site thru google and I'm trying it out atm. Seems to take quite some time so I will get back to you later when my account password hopefully is recovered.
Really great pair of Dplyr videos. Solved 90% of my task of exploring how to perform data manipulation tasks. It will be really helpful if you make similar videos on Functions and loops in R with some good use cases.
Very clear and concise explanation in both the parts. Thank you so much for making the learning awesome !! Please continue to make more such videos on new concepts in R
Very nice pair of tutorials, love this package! Quick thing about matching of the columns 'color'= 'col' - you need to keep them in the order of the tables a and b in the join statement. Meaning, if you did 'col'= 'color' it would give an error, since a does not have 'col' and b does not have 'color'.
When referring to objects created by data_frame as being local data frames and ones created by data.frame as not local. What do you mean by local vs not local?
Amazing videos. Are you going to do anymore videos on R? Such an amazing tool to get stuffs done on your day (wrangle) very fast. I have a request. How could you do a map() with dataframe in R, like giving different names for values in a column. Is there any function in dplyr for this?
Glad you like the video! No, I'm not planning to do any more videos with R - I'm sorry! I work in Python now, and I haven't used R in years. I like both languages, but I prefer to get as good as possible in one language.
Hi, I like this video which is also very useful to me. I need your help that in case we pass column names of df as arguments to a function how to use those variables in functions like select, arrange, distinct, summarise of Dplyr verb. Kindly reply as soon as possible
Perfect video for data manipulation in R. The second video is also great in continuation to the first one. Please upload more tutorials on R. Just one question though- when i run the same code: june%>% group_by(type, city)%>% top_n(3,frieght). Here june is the name of my excel file. and grouping based on type city where top 3 freight to be filters. this gives correct output though as i have 28 columns hence in the R console it only shows 6 columns and remaining reads as variables not shown. Is there a possibility to show all or max columns in the console because i could then take the result to the business user or any alternate you could suggest. Thanks again for the videos. ROCKS!!!!
Shivi Bhatia Glad you are enjoying the videos! To answer your question, you can indeed show more columns. Check out the "Viewing more output" section of this document: rpubs.com/justmarkham/dplyr-tutorial-part-2
Hi thank you very much for the tutorial. This is very helpful. I have one question though. With dplyr 0.50, I could not get the same result as yours at 10:40 of the video. The arrange function sorts all the rows from the highest dep_delay the lowest which messed up the order created by group_by(day, month). Is there an alternative? Thank you.
Great video. Thanks for sharing Kevin! At the moment I'm interested in replacing "for" loops when possible, using dplyr package and the "do" command. I have the following script : ## split initial dataset based on a grouping variable/column ## and save each (new) dataset as a different .csv file data.frame(mtcars) %>% group_by(cyl) %>% do(d=data.frame(.)) %>% do(write.csv(.$d, paste0("data_cyl_",.$cyl,".csv"))) Seems to work, as I can see the .csv files created in my workspace, but it also returns the following error: Error: Results are not data frames at positions: 1, 2, 3 Any ideas or thoughts?
Data School Really keeps (and influences) you thinking from a data frame point of view all the time... cran.r-project.org/web/packages/broom/vignettes/broom_and_dplyr.html
Thank you very much for the great tutorial!
By the way, slice function has new features. This is from the dplyr version history:
slice() gains a new set of helpers:
slice_head() and slice_tail() select the first and last rows, like
head() and tail(), but return n rows per group.
slice_sample() randomly selects rows, taking over from sample_frac()
and sample_n().
slice_min() and slice_max() select the rows with the minimum or
maximum values of a variable, taking over from the confusing top_n().
Thanks for sharing!
best data manipulation tutorial I ve ever found on youtube, keep up your good work, you are a great tutor.
Wow, thanks!
Thank you very much! Can't emphasise how much these two tutorials have helped me :)
+hima sagar You're very welcome! So glad to hear! :)
Really useful pair of tutorials - I'm an experienced R user trying to get my head around the dplyr way of thinking, and these were helpful.
Thanks again,
Anthony Staines Awesome! Thanks for the kind compliment!
Great video on more advance dplyr in R. This makes manipulating of data so smooth, readable and fast. HIGHLY recommended.
Marc Telesha Thanks Marc, glad the video was helpful to you! I agree that readability is so important, which is one reason I'm a big fan of dplyr.
Data School Can I give a slight criticism???
SPACE after every %>% and not lines over 80 characters with three or four %>% it is driving me CRAZY! I know alt+enter is a nice shortcut but ctl-shift-P also works.
Smiles
Marc Telesha Ha! I used nicer formatting in my previous dplyr tutorial, but this time, I decided to write my tutorial code the way I write my real code :) However, I'll consider changing back for my next tutorial!
Data School Thank you if you do :) Even if you don't it is a really good run through of dplyr. It will be intresting to see if Juypter (AKA iPython) Notebook might work better for your tutorials?
Marc Telesha Definitely worth considering! I teach some of my data science classes using IPython notebook, but up to now have not used them for R code. Thanks for the idea!
Intense, to-the-point but very informative, have learned a lot from the pair of dplyr videos, I feel very much comfortable with dplyr.
Great to hear!
You step by for the newbies like me! I love your teaching approach. You are real great tutor!
Thanks!
you prolly dont give a damn but does any of you know of a way to log back into an Instagram account??
I stupidly forgot my account password. I would appreciate any tips you can give me
@Wayne Bruno Instablaster ;)
@Shawn Koda thanks so much for your reply. I got to the site thru google and I'm trying it out atm.
Seems to take quite some time so I will get back to you later when my account password hopefully is recovered.
@Shawn Koda it did the trick and I now got access to my account again. Im so happy:D
Thank you so much you really help me out :D
Really great pair of Dplyr videos. Solved 90% of my task of exploring how to perform data manipulation tasks. It will be really helpful if you make similar videos on Functions and loops in R with some good use cases.
Glad you liked the dplyr videos, and thanks for your suggestion!
Very clear and concise explanation in both the parts. Thank you so much for making the learning awesome !! Please continue to make more such videos on new concepts in R
Glad it was helpful to you! Currently, I'm only making videos on Python, I'm sorry!
Easy to understand with your series of videos on dplyr ...Thanks for lucid explanations
You're very welcome!
Very nice pair of tutorials, love this package! Quick thing about matching of the columns 'color'= 'col' - you need to keep them in the order of the tables a and b in the join statement. Meaning, if you did 'col'= 'color' it would give an error, since a does not have 'col' and b does not have 'color'.
Great point, thanks!
Very Precise, Clear and quite helpful .Thanks
Endale Altaye You're very welcome! Thanks for your kind words.
Awesome man . Now you own me officially.
Ha! Maybe you would like to support Data School on Patreon: www.patreon.com/dataschool
Excellent...! too good explanation
Really really helpful to understand the Rstudio and to munge the Data
Thanks for the kind comment!
Nice job, very helpful !
great tutorial, thank you! coming from stata, this makes R datamanipulation seem much less confusing
Emil Begtrup-Bright Awesome, glad it was helpful to you! Welcome to the world of R :)
Thank you very much, wonderful explanation!
Great video! Lots of useful tricks.
***** Thank you!
When referring to objects created by data_frame as being local data frames and ones created by data.frame as not local. What do you mean by local vs not local?
+Glenn Z Great question! I just answered this on Stack Overflow: stackoverflow.com/a/35605110/1636598
this was a great video, thank you! Any chance you will make other R videos again?
Not any time soon, sorry!
Great tips. Thank you very much.
You're welcome!
Great video. So helpful, thank you
Glad to hear!
Amazing videos. Are you going to do anymore videos on R? Such an amazing tool to get stuffs done on your day (wrangle) very fast. I have a request. How could you do a map() with dataframe in R, like giving different names for values in a column. Is there any function in dplyr for this?
Glad you like the video! No, I'm not planning to do any more videos with R - I'm sorry! I work in Python now, and I haven't used R in years. I like both languages, but I prefer to get as good as possible in one language.
Hi, I like this video which is also very useful to me. I need your help that in case we pass column names of df as arguments to a function how to use those variables in functions like select, arrange, distinct, summarise of Dplyr verb. Kindly reply as soon as possible
Sorry, I don't quite understand your question. Good luck!
What if you're looking to find a combination of sequences that occurred? For example, I want to know how many times X then Y occurred
Sorry, I'm not sure I fully understand your question!
Spread the power of dplyr and R
Alex Bresler Ha, dplyr is indeed awesome!
Great tutorials. Thanks a lot.
You're welcome!
Thank you for the nice tutorial! :)
You're very welcome!
Perfect video for data manipulation in R. The second video is also great in continuation to the first one. Please upload more tutorials on R.
Just one question though- when i run the same code:
june%>% group_by(type, city)%>% top_n(3,frieght). Here june is the name of my excel file. and grouping based on type city where top 3 freight to be filters. this gives correct output though as i have 28 columns hence in the R console it only shows 6 columns and remaining reads as variables not shown.
Is there a possibility to show all or max columns in the console because i could then take the result to the business user or any alternate you could suggest.
Thanks again for the videos. ROCKS!!!!
Shivi Bhatia Glad you are enjoying the videos! To answer your question, you can indeed show more columns. Check out the "Viewing more output" section of this document: rpubs.com/justmarkham/dplyr-tutorial-part-2
Hi thank you very much for the tutorial. This is very helpful. I have one question though. With dplyr 0.50, I could not get the same result as yours at 10:40 of the video. The arrange function sorts all the rows from the highest dep_delay the lowest which messed up the order created by group_by(day, month). Is there an alternative? Thank you.
I'm sure there's an alternative, though I haven't used the latest version of dplyr and so I can't say for sure. Let me know if you figure it out!
Todd Cho use all 3 variables in arrange(month, day, desc(dep_delay))
Thank you Roshan that's the answer!
I have tweeted it! Awesome!!!
Amit Ugle Thanks for sharing! :)
can you please create a tutorial on shiny apps? You are an awesome teacher!
Amit Ugle I will definitely consider it! Shiny does have some great written tutorials: shiny.rstudio.com/tutorial/
my_db
Sorry, I'm not sure why you are getting this error!
Great!
Thanks!
Great video. Thanks for sharing Kevin!
At the moment I'm interested in replacing "for" loops when possible, using dplyr package and the "do" command.
I have the following script :
## split initial dataset based on a grouping variable/column
## and save each (new) dataset as a different .csv file
data.frame(mtcars) %>%
group_by(cyl) %>%
do(d=data.frame(.)) %>%
do(write.csv(.$d, paste0("data_cyl_",.$cyl,".csv")))
Seems to work, as I can see the .csv files created in my workspace, but it also returns the following error:
Error: Results are not data frames at positions: 1, 2, 3
Any ideas or thoughts?
tonkouts I'm sorry, I wish I could help but I'm not that familiar with the do() function!
Data School No problem. Do function is very helpful. Especially when it's combined with "broom" package to create tidy models (model outputs).
tonkouts Neat! I'll have to check out "broom", thanks!
Data School Really keeps (and influences) you thinking from a data frame point of view all the time... cran.r-project.org/web/packages/broom/vignettes/broom_and_dplyr.html
tonkouts Wow, great vignette!
Awsome
Thanks!
You speak waaaay too slow for my liking. I'd recommend speeding up the speech in your next videos. Other than that, the content is good! Thanks.
Glad you like the content!