In this tutorial, we will learn how to collapse multiple rows from a column to a single row based on another column/group. Let us get started by loading tidyverse and checking the tidyr package version. To illustrate collapsing multiple rows into single one, let us create a toy dataframe with continents and countries. Our aim… Continue reading How to collapse multiple rows based on a column