How to select top and bottom rows by a column simultaneously

In this tutorial, we will learn how to select top and bottom rows of a dataframe based on the values of a column with tidyverse in R. Here we will see a specific approach to get top and bottom rows when the values of the column of interest has both positive and negative values. This… Continue reading How to select top and bottom rows by a column simultaneously

slice_max: get rows with highest values of a column

dplyr's slice_max(): Rows with highest values for a column

In this tutorial, we will learn how to get rows with maximum values of a column or variable from a dataframe. For example, from a dataframe with multiple rows and columns we will find a row (or multiple rows) with maximum values for a column. We will use dplyr’s slice_max() function to select rows with… Continue reading slice_max: get rows with highest values of a column

Exit mobile version