add_id: Enrich source data with an ID

View source: R/add_id.R

add_idR Documentation

Enrich source data with an ID

Description

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

Usage

add_id(data)

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

library(stranger)
data(iris)
(iris.id <- add_id(iris))

welovedatascience/stranger documentation built on Oct. 12, 2022, 10:52 p.m.