rn_col | R Documentation |
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.
rn_col(.data, var = "rowname")
col_rn(.data, var = "rowname")
.data |
A data.frame. |
var |
Name of column to use for rownames. |
rn_col
returns a data.table,
col_rn
returns a data frame.
mtcars %>% rn_col()
mtcars %>% rn_col("rn")
mtcars %>% rn_col() -> new_mtcars
new_mtcars %>% col_rn() -> old_mtcars
old_mtcars
setequal(mtcars,old_mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.