A new version of the R package Patchwork is available on CRAN. If you are not familiar with the Patchwork, it is a R package developed by “one and only” Thomas Lin Pedersen and it makes it possible to combine multiple plots made with R either ggplot2 or base R into a single graphics. As […]
R
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 […]
How to Compute Summary Statistics Across Multiple Columns in R
dplyr’s groupby() function lets you group a dataframe by one or more variables and compute summary statistics on the other variables in a dataframe using summarize function. Sometimes you might want to compute some summary statistics like mean/median or some other thing on multiple columns. Naive approach is to compute summary statistics by manually doing […]
dplyr groupby() and summarize(): Group By One or More Variables
dplyr, is a R package provides that provides a great set of tools to manipulate datasets in the tabular form. dplyr has a set of core functions for “data munging”,including select(),mutate(), filter(), groupby() & summarise(), and arrange(). dplyr’s groupby() function is the at the core of Hadley Wickham’ Split-Apply-Combine paradigm useful for most common data […]