5.0 / 5
We will cover the following tasks in 34 minutes:
There is a great cheat sheet. It’s on RStudio’s website. In this section I will show you where it is and we will go over some of the common functions. After that I’ll show you Rhyme’s amazing Interface and then I’ll give you a quick bio about me. I’ll see you when you get in.
In excel we hide columns we delete columns we cut and past columns. In R using dplyr and the verb select we create new data frames with a simple call with only the columns we need. This is really cool. But don’t take my word for it. Come in and experiment for yourself.
In excel we hide rows and cut them and paste them. We use filters to filter the rows. Well in R. It’s as simple as using the verb Filter. When using this filter with Boolean logic we can create data frames with only the data we want. This function combined with Select gives you a lot of control over your data. Instead of hiding things you have your main data frame and sub data frames based on the criteria you want. After this is done, if you so choose, you can write the dataframes to excel using the write.csv function.
The Pipe. This is something Hadley Wickham borrowed from the Maggitr package. From now on when you hear pipe think glue. Using this glue we can paste our functions together seamlessly. This has a couple of side effects. One is that the code is easy to read. Others code is easier to read. Also, creating sub data frames is easy as is visualizing what you want your data frame to look like - even before you start writing the code. Awesome.
So you want to arrange your data alphabetically? Numerically? How about two different columns? Arrange is your function. This doesn’t have the same magical effects as Select and Filter but it does serve its purpose. Come in and I will show you how to its used.
This is my favorite. Think pivot table in Excel on steroids. I’ll walk you through its magic. By the way, this lesson is a two’fer since I will throw in the group_by function as well. Join me and I’ll show you all about this wicked verb combo.
So you want to create some more variables for feature engineering or you want the percentages of a few different columns or you want the mean and standard deviation. With Mutate this is a breeze. Come in and I’ll show you how this works.
You have completed the Intro to Dplyr. By this point you are seeing the power of dplyr and R. But. You must practice. Everyday for two weeks. I promise after that you’ll be doing data hand springs through your data manipulation problems.
About the Host (Chris Shockley)
I am a 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 am single too. Maybe because I spend too much time playing? I have a dog named Coog (Lllasa Apso), who would rather be outside than inside, which means I have to take him on a lot of walks. 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. My hope is that I can help you, even if its with my enthusiasm. Yes you can learn R and 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.