Learn R Programming

wrangle (version 0.6.4)

sort.grouped_df: Arrange by groups.

Description

As of 0.5, dplyr::arrange ignores groups. This function gives the old behavior as a method for generic base::sort. Borrowed from Ax3man at https://github.com/hadley/dplyr/issues/1206.

Usage

# S3 method for grouped_df
sort(x, decreasing = FALSE, ...)

Value

grouped_df

Arguments

x

grouped_df

decreasing

logical (ignored)

...

further sort criteria

Examples

Run this code
library(dplyr)
head(sort(group_by(Theoph, Subject, Time)))

Run the code above in your browser using DataLab