resetRowNames: Reset row names to 1:n

View source: R/dataFrame.R

resetRowNamesR Documentation

Reset row names to 1:n

Description

Reset the row names of a data frame x to 1:nrow(x) by setting the row.names attribute to NULL.

Usage

resetRowNames(x)

Arguments

x

data frame or matrix

Examples

persons <- data.frame(id = c(1, 2, 3), name = c("Peter", "Paul", "Mary"))

persons.ordered <- persons[order(persons$name), ]

# Original row names
persons.ordered

# Reset row names
resetRowNames(persons.ordered)


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.