row_number.: Return row number

Description Usage Examples

View source: R/row_number.R

Description

Returns row number. This function is designed to work inside of mutate.()

Usage

1

Examples

1
2
3
4
5
6
7
8
test_df <- data.table(x = rep(1, 3), y = c("a", "a", "b"))

test_df %>%
  mutate.(row = row_number.())

# The dplyr version `row_number()` also works
test_df %>%
  mutate.(row = row_number())

mtfairbanks/gdt documentation built on May 4, 2021, 9:44 a.m.