In this tutorial, we will learn how to add row numbers with in each group of a dataframe in R. We will use combination of group_by() and row_number() functions from dplyr to add row number by group. To get started let us load tidyverse and palmer penguin datasets. Here we use dplyr version 1.0.8. For… Continue reading How to add row number within each group in dplyr