R row_number()

  • Assigns a unique, sequential row number to each row in a data frame or tibble
  • Useful for performing operations based on row order
  • From the dplyr package
  • Similar to base R nrow()
  • Use arrange() to control numbering based on specific column values

Example: 1

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top