Going deeper with dplyr: New features in 0.3 and 0.4 (video tutorial)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
In August 2014, I created a 40-minute video tutorial introducing the key functionality of the dplyr package in R. dplyr continues to be my “go-to” package for data exploration and manipulation because of its intuitive syntax, blazing fast performance, and excellent documentation.
I recorded that tutorial using the latest version at the time (0.2), but there have since been two significant updates to dplyr (versions 0.3 and 0.4). Because those updates introduced a ton of new functionality, I thought it was time to create another tutorial!
This new tutorial covers the most useful new features in 0.3 and 0.4, as well as some advanced functionality from previous versions that I didn’t cover last time. (If you have not watched the previous tutorial, I recommend you do so first since it covers some dplyr basics that are not covered in this tutorial.)
Table of contents
This new tutorial runs 37 minutes, but if you only want to watch a particular section, simply click the topic below and it will skip to that point in the video:
- Introduction (starts at 0:00)
- Loading dplyr and the nycflights13 dataset (starts at 1:12)
- Choosing columns:
select
,rename
(starts at 2:28) - Choosing rows:
filter
,between
,slice
,sample_n
,top_n
,distinct
(starts at 5:40) - Adding new variables:
mutate
,transmute
,add_rownames
(starts at 12:38) - Grouping and counting:
summarise
,tally
,count
,group_size
,n_groups
,ungroup
(starts at 15:20) - Creating data frames:
data_frame
(starts at 23:01) - Joining (merging) tables:
left_join
,right_join
,inner_join
,full_join
,semi_join
,anti_join
(starts at 25:28) - Viewing more output:
print
,View
(starts at 31:29) - Resources (starts at 34:41)
The video is embedded below, or you can view it on YouTube:
You can view the R Markdown document used in the video on RPubs, or you can download the source document from GitHub.
Here are the resources I mention in the video:
- Release announcements for version 0.3 and version 0.4
- dplyr reference manual and vignettes
- Two-table vignette covering joins and set operations
- RStudio’s Data Wrangling Cheat Sheet for dplyr and tidyr
- dplyr GitHub repo and list of releases
My previous tutorial is embedded below, or you can view it on YouTube:
If you have any questions about dplyr, I’d love to hear them in the comments!
If you’d like to be notified when I release new videos, please subscribe to my YouTube channel. I also blog about a wide array of data science topics, including R, Python, Git, and machine learning, and have an email newsletter if you’d like to hear about that content!
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.