[VIDEO]How To Use R With Sport Science Data: Practical Demonstration 1

I mentioned on twitter about doing videos using R with sport based data, here is the first in a series of such videos. We will cover basic functions initially before moving on to more advanced methods. In this video we look at filtering data; changing data type; creating new variables plus a quick look at the dplyr::case_when function.

  • Notice how I was able to carry out changes at speed and view them without making permanent until desired
  • Info on projects in Rstudio (I recommend anyone not using projects start to involve them)
  • Packages/functions Used:
    • tidyverse
      • readr – read_csv
      • dplyr – glimpse; filter; mutate; group_by; count; arrange; case_when; summarise; summarise_if)
    • magrittr (pipe functions: %>%; %<>%)
    • lubridate (dmy; week)

Who can count the number of mistakes I make?? 😉 It may just be me but it’s strangely comforting when I see people more experienced at R coding make mistakes as well. Accepting mistakes will happen is important. If this was a recording of me working on a more detailed script not only would I make more mistakes, you would also see me spending a lot of time searching google for answers!

In the next video we will cover some more approaches around filtering data, simple ways to add meaning to the data along with basic plotting of data.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.