How to use the R case_when function

How to use case_when in R

This tutorial will show you how to use the case_when function in R to implement conditional logic like if/else and if/elif/else. It explains the syntax, and also shows clear examples in the examples section. You can click on any of the links below, and it will take you to the appropriate section in the tutorial. … Read more

A Quick Introduction to Dplyr

An image that shows some dplyr code.

There’s sort of an open secret in the data science world: As a data professional, you’ll spend a huge amount of time doing data preparation. Cleaning, joining, reshaping, aggregating … These tasks make up a huge amount of your data work. Many data professionals say as much as 80%. You Need to Master Data Manipulation … Read more

R Data Exploration: covid-19 [part 3]

An image of R code analyzing covid19 data, with a sars-cov-2 virus in the background.

This tutorial is part of a series of R tutorials analyzing covid-19 data. For parts 1 and 2, see the following posts: Covid19 analysis, part 3: initial data exploration So far in our R data analysis series, we’ve spent some time getting and wrangling our data. In part1, we retrieved a single covid19 … Read more

R Data Analysis: covid-19, part 2 [merge datasets]

This tutorial is part of a series of R tutorials analyzing covid-19 data. For part 1, see the following post: Covid19 analysis, part 2: merge datasets In this tutorial, we’re going to set up a process that will enable us to retrieve and wrangle some necessary covid19 datasets … data that we’ll need for … Read more

How to use mutate in R

If you want to master data science in R, you need to master foundational tools like the mutate() function. Readers here at the Sharp Sight blog will know how much we emphasize “foundational” data science skills. If you want to be effective as a junior data scientist, you need to master the fundamental skills. If … Read more

How to rename columns in R

In this blog post, I’ll show you how to rename columns in R. This is pretty straightforward if you know how to do it properly, but there are also some little challenges in renaming variables. So very briefly, I’ll explain why renaming variables in a dataframe can be a little confusing in R. Then, I’ll … Read more