add_id: Enrich source data with an ID

Description Usage Arguments Details Value Examples

View source: R/add_id.R

Description

add_id just ensures data is a data.table and adds a columns named .id

Usage

1

Arguments

data

Source data (data.frame or data.table)

Details

add_id in called behing the scence by crazyfy if needed to ensure a valid id is present in source data. Still, we recommand to start from a dataset already having an id, be it generated by a call to add_id or already pre-existing to ensure correct source data enrichment.

Value

data.table object with a column named .id

Examples

1
2
3
library(stranger)
data(iris)
(iris.id <- add_id(iris))

stranger documentation built on March 18, 2018, 2:01 p.m.