name_rows: Re-set the row names of a data.frame with a column and delete...

Description Usage Arguments Value Examples

View source: R/name_rows.R

Description

Re-set the row names of a data.frame with a column and delete it from the df.

Usage

1
name_rows(df, column)

Arguments

df

A data.frame

column

A character string denoting the column to be used for renaming.

Value

A data.frame with the given column as row names and without the column

Examples

1
2
3
4
5
x <- head(mtcars)
x$names <- rownames(x)
rownames(x) <- NULL
x <- name_rows(x, "names")
x

pedrostrusso/prlib documentation built on May 5, 2019, 11:01 p.m.