Learn R Programming

tidytable (version 0.8.0)

row_number.: Return row number

Description

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

Usage

row_number.()

Arguments

Examples

Run this code
df <- data.table(x = rep(1, 3), y = c("a", "a", "b"))

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

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

Run the code above in your browser using DataLab