top of page

Google Data Analytics Professional Certificate | 7 Data Analysis with R Programming

Jan 4, 2024
7 min read

tl:dr

  • I’m currently completing the Google Data Analytics Professional Certificate in an effort to sidestep careers to become a Data Analyst

  • I just wanted to reflect on some specific things that surprised me, made me think or something I can relate back to volleyball analysis.  They include:

    • Learning the programming language for R is still very hard

    • Remembering that a data frame is just a table of data

    • Struggling for motivation to complete the course

  • I also did a mini-task of creating a jitter plot using the geom_jitter() function

Reflecting on Course 6 | Data Analysis with R Programming

I am currently completing the Google Data Analytics Professional Certificate in an effort to sidestep careers and become a Data Analyst.  It has eight courses and I wanted to reflect on each before moving on to the next course.  See the links below as I update them.

This blog post isn’t a full recap of the course.  I just wanted to reflect on specific things that surprised me, made me think or something I can relate back to volleyball analysis.

Learning Another Programming Language (R)

R is a programming language for statistical computing and graphics and it is the main focus of the course.  Like SQL before it, I find programming language difficult to learn.  One missing character or a missing capitalised letter and the code returns an error.  I had one situation where I needed to load the dataset “palmerpenguins” using the library function.  I wrote the code below.  

library(palmerpengiuns)

When I ran the code, it kept returning an error that the dataset didn’t exist.  It looked exactly how the instructor wrote it.  Some of you may have spotted where the issue is.  For me, I swear it took me 30 minutes before I realised it was because I misspelt penguins (the “u” and “i” are swapped).  

In the final course assessment, I was tasked to write some simple code to find the correct answer.  The question even tells you what function to use and where to put it and I still struggled with it.  I know that if I am on my own and not being told what function to use, I am going to struggle to write my own R code.  

Remembering What Data Frames Are

I remember learning about data frames two years ago when I first started the Microsoft Data Analysis course.  It is essentially a table of data.  I learnt that you can manually create one yourself where you state what the column names are and the data each column contains.  I then imagined what if you had 100 lines of data that you had to input manually!  That would take ages to write out.  Thankfully, the course said you usually import data frames like .csv files.

Struggling for Motivation

Not gonna lie, it was a real struggle to complete this course.  I had several free days where I was going to concentrate on doing this course.  However, procrastination hits and rather than knocking off 5-6 hours to do the course, I may only do 1-2 hours.  Some days I didn’t even do any hours!  I’m not sure why.  In the earlier courses, it was easier to fly through the course.  It could be because it was pretty easy, e.g. learning how to use Excel, whereas now learning SQL and R is super difficult.  I’m not sure why.  In the earlier courses, it was easier to fly through the course.  It could be because it was pretty easy, e.g. learning how to use Excel, whereas now learning SQL and R is super difficult.  I do need to find ways to motivate myself.  I may have to sit down and just find the best ways where I sit down and work, e.g. during my break at work or leaving the house to do work.

Mini-Task: Creating a Jitter Plot

A jitter plot is like a regular scatter plot [geom_point() function] but it adds a little “noise”.  That is, it adds a small amount of random variation to the location of each point.  I did think why have a point that isn’t where the data says it should be?  However, when I saw it in action, I immediately thought it would have been useful to apply it to an old chart (see below) from this blog post.  You can see all the points are bunched up in a single line.  I did change the points into crosses to make it look slighter better.  However, a little noise, i.e. points slightly off the single line, would be visually useful.  

I then thought that creating a jitter plot in R using similar data (taken from the Women’s Super League, 2019-20) would be a great mini-task to do.  The aim is super simple but I’m sure writing the code would not be as easy as it sounds.  

It was a great little task to undertake.  I learn a ton of tiny little things.  I ran into a bunch of issues that I had to resolve, e.g. that I needed backticks when referring to the column ‘PEff%_DIff’.  Since I knew how I wanted the chart to look, e.g. changing the size, shape and colour of the points, I had to Google how to do those things.  The code for the jitter plot can be seen below.  Just seeing it does make me happy I wrote a decent size code.  

The regular and jitter scatter plots can be seen below (use the slider to compare plots).  I do think the jitter plot looks slightly better compared to the regular scatter plot.  The one thing missing is a legend showing how the orange points are the individual sets and the black points are the average for each set score difference.  I now just realised how the y-axis numbers are not in it’s percentage form.  I’m sure I can Google the answer to fix it.  

“openvolley” and “volleyR” R Packages

Another thing I wanted to do before starting the final Google Analytics course was look into R packages (code and data to do specific functions) from Ben Raymond and Chad Gordon.  Ben Raymond from Science Untangled has openvolley, an R package for reading DataVolley (.dvw) files.  I actually had this package open in RStudio when I opened it to complete this course.  I must have opened it 2 years ago!  I also know Chad Gordon from I actually had this package open in RStudio when I opened it to complete this course.  I must have opened it 2 years ago!  I also know Chad Gordon from VolleyDork has has volleyR, which calculates Expected Values.  It is something I can do already (see , which calculates Expected Values.  It is something I can do already (see Expected SideOut and Break Point % and and Expected Hitting %) but this could be a much easier way to do it, rather than exporting tonnes of data from DataVolley.  ) but this could be a much easier way to do it, rather than exporting tonnes of data from DataVolley.  

So it was pretty easy to install openvolley.  Ben also gave some code to see some specific analysis from an example file, e.g. hitting % for both teams by zone.   The code can be seen below with the output underneath that.  Reading that code is like reading Spanish.  I can catch some words but I don’t know what it all means.  I’m not sure if you have full access to codes for all the analyses (it could all be on GitHub but I don’t know how to use it).  However, I thought you don’t really need it because I think it’s all done in his match reports and team reports apps.  You just upload the DataVolley files and generate a report.  This experience did tell me that I could write my old R code, on the back of openvolley R package, to write my own match reports.  I could lay out the analyses the way I want them to (e.g. point-scoring stats) and use performance indicators (e.g. point-scoring efficiency %) that I specifically use.  However, I am a long way off from being able to do that.  

I did try and open the “volleyR” R package from Chad Gordon.  Sadly, the code he provided required me to open and install his “volleyR” R package from his Github account.  However, when I ran the code, it says that the “volleyR” R package doesn’t exist.  I actually went to his Github account and I couldn’t see a volleyR package.  I’m not sure if he removed it or not.  

Final Thoughts

Learning to program, whether on SQL or R, is going to be a long slog.  I imagine this is where doing Computer Science as a degree helps out a lot in this respect.  I know I will need so much practice in using these programs.  I also know there’s Python out there, another programming language that I will definitely need to be familiar with.  

I was happy I did the mini-project to learn R a bit better.  I was also happy I looked into the “openvolley” and “volleyR” R packages.  I didn’t learn too much from using R but it did show me what can be done.  

The final course is to complete an actual data analysis project.  I am planning on doing a real project that will have a real problem to solve.  This is opposed to some made-up project with a fake purpose and no real-life consequences.  Hopefully, this should get me motivated towards doing the work rather than procrastinating.  

Charting My Pages of Notes

Since this is a data analytics course, I thought I should chart something.  I went with the number of pages of notes I typed up.  It’s a proxy indication of things I didn’t know.  

 
 
 

Comments


bottom of page