Learn R Programming

mark (version 0.8.1)

to_row_names: To row names

Description

Converts a column to row names

Usage

to_row_names(data, row_names = 1L)

Value

A data.frame

Arguments

data

A data.frame

row_names

The numeric position of the column.

Examples

Run this code

x <- data.frame(
  a = 1:4,
  b = letters[1:4]
)

to_row_names(x)
to_row_names(x, "b")

Run the code above in your browser using DataLab