resetRowNames | R Documentation |
Reset the row names of a data frame x to 1:nrow(x) by setting the
row.names
attribute to NULL
.
resetRowNames(x)
x |
data frame or matrix |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.