name_in: Name and unname data frames

Description Usage Arguments Examples

View source: R/dfname.R

Description

Return a data frame with rownames moved into a named column, or vice versa.

Usage

1
2
3
name_in(d, col_name = "name")

name_out(d, col_name)

Arguments

d

A data.frame

col_name

For name_in, the name of the column to which rownames will be copied. For name_out, the name of the column to move into rownames.

Examples

1
2
3
unnamed_cars <- name_in(mtcars, "car_name")

cars <- name_out(unnamed_cars, "car_name")

mdlincoln/dfname documentation built on May 22, 2019, 4:06 p.m.