Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rownames

Tools for working with row names


Description

The enhanced data.frame, including tibble and data.table, do not support row names. To link to some base r facilities, there should be functions to save information in row names. These functions are analogous to rownames_to_column and column_to_rownames in tibble.

Usage

rn_col(.data, var = "rowname")

col_rn(.data, var = "rowname")

Arguments

.data

A data.frame.

var

Name of column to use for rownames.

Value

rn_col returns a data.table, col_rn returns a data frame.

Examples

mtcars %>% rn_col()
 mtcars %>% rn_col("rn")

 mtcars %>% rn_col() -> new_mtcars

 new_mtcars %>% col_rn() -> old_mtcars
 old_mtcars
 setequal(mtcars,old_mtcars)

tidyfst

Tidy Verbs for Fast Data Manipulation

v0.9.9
MIT + file LICENSE
Authors
Tian-Yuan Huang [aut, cre] (<https://orcid.org/0000-0002-3591-4203>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.