# Data Analysis with R: More dplyr

In this course we will be solidifying our learning by building upon concepts that we covered in the Dplyr Intro course.
We will also be advancing our learning too. I will show you how to use the verbs to do some more complex data gymnastics (you will find these very helpful - trust me). As an added bonus I picked a data set that has some silly data. You will learn some interesting trivia. Hint: How long do cows sleep on average per night? How about the weight of the human brain? via the dataset we will be using, like how a Cow sleeps 4 hours a day? Come on in and let’s get started.

Duration (mins)

Learners

#### 5.0 / 5

Rating

We will cover the following tasks in 32 minutes:

### Introduction

In this lesson I’m going to introduce you to the dataset and a few of the topics we will be covering. While I’m doing that I’ll show you how to use the Rhyme Interface (in case you don’t know already) and give you a short bio. Remember that learning R is easy but does take some practice. The good thing, however, is that it isn’t like learning classical piano.

### Mutate Refresher

The verb Mutate is one of the more powerful verbs in the dplyr suite. The verb can create new variables while preserving the old ones. And here’s a cliff hanger. You can pass homemade functions (user defined functions) through the Mutate function. Why would you do this? To save yourself time in creating a for loop. But first things first. Come in and get a refresher.

### More Mutate

In this chapter we’re going to create a few new variables in our data. This manipulation will allow us to easily spot which animals sleep the least. This is a common manipulation when looking at data for the first time. Come in and I’ll show you how this is done.

### Mutating Rows as opposed to Columns

What? You can manipulate data rowise? Yep. In this lesson I will show you how. I will also share an inspiring story about the day that you take the training wheels off of R and make it your goto for data analytics.

### Mutate with an If Else Statement

There are multiple ways to do the same thing in R. But. You should always be on the lookout for the most elegant way of doing something. In this example I’m going to show you how to do an If Else statement within a mutate function. While it’s pretty easy to do the same thing Base R way but it’s more efficient and elegant to do it the way I’ll show you. And it’s consistent with the rest of the code. Let’s get after it.

### Mutate_All

When scraping data you will quickly learn that the data often needs to be cleaned. For example spaces need to be removed, certain character, and maybe you need to change some characters to upper or lower (or any combination of things). Using the Mutate All function you can do this in a singular step - instead of creating complicated for loops or functions. If you haven’t taken my data harvesting course on web scraping this will be a handy function for some of those problems. Let’s just go over this now.

### Final Thoughts

You’ve done well. At this point you can do basic functions along with some more complicated ones. I recommend you practice for a couple weeks every day and then put the R training wheels in the garage and go for a cruise. Thank you for your time. I’ll see you in the next course.

## Watch Preview

Preview the instructions that you will follow along in a hands-on session in your browser.

## About the Host (Chris Shockley)

I am an R enthusiast, hiker, and amateur astronomer. My favorite hike is located in Mt. Rainier National Park, my favorite Deep Sky Object is Alberio, and my favorite R package is dplyr (since I use it everyday). I have a dog named Coog (Lllasa Apso), and I love talking about Coog (as you'll find out soon). I work as a Data Analyst/Financial Analyst for a Metals Co. located in Seattle, WA. I have been in my current position for 4 years. I work primarily in R for Analytics and R Shiny for Deployment. I have built numerous apps over the past few years. My hope is that I can help you in learning R. Yes, the Rhyme Interface will help you. But. You also must take what you learn and practice, practice, practice. So... Let's get after it. See you soon.

## Frequently Asked Questions

##### How is this different from YouTube, PluralSight, Udemy, etc.?
In Rhyme, all projects are completely hands-on. You don't just passively watch someone else. You use the software directly while following the host's (Chris Shockley) instructions. Using the software is the only way to achieve mastery. With the "Live Guide" option, you can ask for help and get immediate response.
##### What do I need to install / configure to join this session?
Nothing! Just join through your web browser. Your host (Chris Shockley) has already installed all required software and configured all data.
##### How do I create my own sessions like this?
You can go to https://rhyme.com/for-companies, sign up for free, and follow this visual guide How to use Rhyme to create your own sessions. If you have custom needs or company-specific environment, please email us at help@rhyme.com
##### Can I buy Rhyme sessions for my company or learning institution?
Absolutely. We offer Rhyme for workgroups as well larger departments and companies. Universities, academies, and bootcamps can also buy Rhyme for their settings. You can select sessions and trainings that are mission critical for you and, as well, author your own that reflect your own needs and tech environments. Please email us at help@rhyme.com
##### I have a different question
Please email us at help@rhyme.com and we'll respond to you within one business day.

36 minutes
36 minutes
26 minutes
34 minutes
44 minutes
44 minutes
26 minutes
41 minutes
31 minutes