add_var_id: Add a variable id at first column in dataset

View source: R/add-var.R

add_var_idR Documentation

Add a variable id at first column in dataset

Description

Add a variable id at first column in dataset

Usage

add_var_id(data, name = "id", overwrite = FALSE)

Arguments

data

A dataset

name

Name of new variable (as string)

overwrite

Can new id variable overwrite an existing variable in dataset?

Value

Data set containing new id variable

Examples

library(magrittr)
iris %>% add_var_id() %>% head()
iris %>% add_var_id(name = "iris_nr") %>% head()

explore documentation built on Sept. 11, 2024, 7:40 p.m.