One of the most common activities while doing data analysis is to reshape data from one form to another. For human eyes and data collection, often it is easier to work with data in wider form. However, for analyzing data it is more convenient to have the data in tidy/long form in most circumstances. tidyr, […]
tidyverse 101
How To Reshape Tidy Data to Wide Data with pivot_wider() from tidyr
Reshaping the data from one for form to another is one of the most common data munging activities. tidyr, R package part of tidyverse, provides core functions to manipulate datasets in wide or long form. In this post, we will see examples of one of tidyr’s core function pivot_wider() to convert data in long tidy […]
How To Remove Rows with Missing values using dplyr
Missing data is a common problem while doing data analysis. Sometimes you might to remove the missing data. One approach is to remove rows containing missing values. In this post we will see examples of removing rows containing missing values using dplyr in R. We will use dplyr’s function drop_na() to remove rows that contains […]
How To Move A Column to the Front with dplyr
In this post we will learn how to change column order or move a column in R with dplyr. More specifically, we will learn how to move a single column of interest to first in the dataframe, before and after a specific column in the dataframe. We will use relocate() function available in dplyr version […]
4 ways to select columns from a dataframe with dplyr’s select()
dplyr’s select() function is one of the core functionalities of dplyr that enables select one or more columns from a dataframe. With dplyr’s version 1.0.0, select() function has gained new functionalities that makes it easy to select columns in multiple ways. One of the most common ways to select columns is to use their names. […]