sort.data.frame: Sort a data frame using one of its variabes as index

View source: R/hammock.R

sort.data.frameR Documentation

Sort a data frame using one of its variabes as index

Description

Sorts a data frame using a variable within that data frame as an index. it's basically just x[order(x[[by]])] Could be written as a method of 'sort' for data frame but need 2 figure out how to do it

Usage

## S3 method for class 'data.frame'
sort(x, decreasing = FALSE, by, ...)

Arguments

x

a data frame

decreasing

passed to order

by

name of the

...

additional args passed to next method if they get a chance

Value

a sorted data frame


lebatsnok/hammock documentation built on Dec. 2, 2022, 6:25 a.m.