rownames: Tools for working with row names

rownames_as_columnR Documentation

Tools for working with row names

Description

Tools for working with row names

Usage

rownames_as_column(x, var = "rowname")

column_as_rownames(x, var = "rowname")

Arguments

x

A data frame.

var

Name of column to use for rownames. For column_as_rownames(), this argument can be the variable name or the column number.

Value

rownames_as_column() and column_as_rownames() both return a data frame.

Examples

# Convert between row names and column --------------------------------
test <- rownames_as_column(mtcars, var = "car")
test
head(column_as_rownames(test, var = "car"))


datawizard documentation built on Sept. 25, 2022, 5:06 p.m.