Base R gives you a simple way of loading packages into your R workspace by using the library() function. It’s a straight forward call that powers most of what you do past the basics.
However — when you need to load multiple libraries — the library() call can get a little bit tedious. For example, say I wanted to load the following packages:
To call all four using the library() function, I would need to use library() on four separate lines:
library(dplyr)
library(psych)
library(covid19.analytics)
library(ggplot2)
It’s either that or create a list function. Either way, it’s…
Yes, the pandemic sucks. But as someone who looks at data for a living, there are at least opportunities for growth, even in the worst of times!
One way you can grow as a data scientist is to look at the ways infection rates affect other related variables (just be sure to take a removed analytical approach, as putting emotion into this can be… less than ideal).
To begin, just install the covid19.analytics package made my Marcelo Ponce and Amit Sandhel using the following command:
install.packages("covid19.analytics")
Then all you have to do is load the library using:
library(covid19.analytics)
After you’ve…
Summary statistics are an essential first step to understanding your data. Luckily, the dplyr package has a super easy to use function that will allow you to quickly calculate summary stats. In this tutorial, we will:
- Review the components of the summarize() function
- Go over some use cases
We’ll be piping data so I’m going to assume you already have some familiarity with dplyr. You should also note that summarize() is the same as summarise(), so use whichever notation is most commonly used in your native language.
As always, load the dplyr package using:
library(dplyr)
In this tutorial…
The NBA is coming back.
At least, for a little while. We’ll see how well they hold up in the Orlando bubble surrounded by a pandemic hot zone.
But enough of the sadness. Let’s talk actual basketball. It feels like forever since live NBA action. The last games were played on March 11, but that might as well have been a year ago. I’m not even sure I remember how sweet a Luka step-back looks.
Do you?
To re-familiarize yourself with the NBA before play restarts, you should probably rewatch games on League Pass. …
I like to write. At least, that’s what I tell myself.
But I’m 100% guilty of not writing consistently.
I could blame it on a lot of things — both intrinsic and extrinsically motivated — but the reality is that I don’t write a lot because I’m scared of failing.
I’m scared of typos. I’m scared of not explaining my opinion correctly. I’m scared of being wrong.
I’m just scared.
Some of this is due to my anxious nature. The current pandemic climate doesn’t help. …
I love science. Truly and deeply love it.
But it’s not perfect.
In fact, one of the defining characteristics that makes the field so special is also one of its biggest weaknesses when it comes to knowledge dissemination.
One of the things I love most about science is that scientists care deeply about their projects. They read all the literature. They think long and hard about their projects. They use appropriate statistical techniques to make sure their results are valid.
But the meticulous nature of the field is also one of the reasons most scientists suck at writing. There’s already…
Learning how to do sports analytics in is a great way to learn data science and machine learning techniques. I recently ran across a Twitter thread that had a great bunch of recommendations for books to read on the subject. Here they are, outlined by category:
In this article you'll learn how to:
- install and load nbastatR
- get every NBA player loaded into R
- get a player's career statistics
The NBA season is on hold. Which, you could look at as a negative and just watch “The Last Dance” on repeat.
Or, you could look at this as an opportunity to finally learn how to do some data science on the NBA and really learn the history of the league and the players.
There are a few R packages that that let you grab NBA data. I use the one called nbastatR because…
Videos are an easy way to add more engagement to your Medium article. YouTube is king when it comes to online videos, but Dailymotion also has a sizeable audience. According to their website:
Dailymotion attracts 300 million users from around the world, who watch 3.5 billion videos on its player each month.
Fortunately, Medium provides an easy way to embed Dailymotion videos directly into your article. Here’s what an embedded Dailymotion video looks like:
Below are two ways you can embed a Dailymotion video on Medium.
PhD Student @ University of Guelph. I study nostalgia and prejudice in consumer behaviour contexts.