Day 9: Data Transformation - Power in disguise
I don't know about you but, I've been finding R to be a fun journey so far.
Thanks to our daily progress, one step at a time, I'm beginning to get some comfort. So I decided to reach out to a colleague today at work
Why?
Because they've been running some R code recently and I was curious:
Can I make sense of the code?
I start scrolling through the code.
It wasn't the shortest code in terms of length.
(It was more than a 1000 rows)
But...
As I skimmed through, I was able to make sense of what the code was saying
A month ago, I would have been clueless as to what the code was trying to do 🥲
Why am I telling you this?
Because, I understand that it can be a little challenging to learn a new language.
You might feel like you are NOT getting it but the truth is
It makes sense after some time
How do I know? because I've been there and there's one thing that helped me along the way
Understanding what I was doing
And, it's for that very reason I want to emphasise on the importance of data transformation.
Normally, I would simply start with the code, ask you to execute and view the results, but with data transformation it's going to be a little different
Before you begin any analysis
Before you begin any reporting
Before you begin any submissions
Your main goal is to get the data to transform through various stages
Sometimes you need to filter out data
Sometimes you need to arrange data differently
Sometimes you need to identify distinct pieces from your data
Once you understand how to do these specific tasks (and some others that will come soon), you can get the data into any stage required for the main task at hand
The main package that will help us with all of this is the dplyr package.
It's already part of the tidyverse package so you don't need to install anything
Tomorrow we'll begin with one of the first functions in dplyr - 'filter'
We'll work on the flights data set (which I hope you have installed using yesterday's email)
See you on Day 10 🗽