add_rank_indices: Arrange a data frame and rank indexes.

Description Usage Arguments Value Examples

View source: R/add_rank_indices.R

Description

Arrange a data frame and rank indexes.

Usage

1
add_rank_indices(.data, ..., arrangeTerms = NULL, orderColumn)

Arguments

.data

data.frame

...

force later arguments to bind by name.

arrangeTerms

character vector of column expressions to arrange by.

orderColumn

character name of column to add in-group order marks to.

Value

.data with order indices added (no ties).

Examples

1
2
3
4
5
6
7
datasets::mtcars %.>%
  # tibble::rownames_to_column() not currently re-exported by dplyr
  mutate_se(., "CarName" := "rownames(.)" ) %.>%
  select_se(., c('CarName', 'hp', 'wt')) %.>%
  add_rank_indices(., arrangeTerms = c('desc(hp)', 'wt'),
                   orderColumn = 'rankID') %.>%
  arrange_se(., 'rankID')

seplyr documentation built on Sept. 5, 2021, 5:12 p.m.