assert_pk: Assert the data.table has a primary key

Description Usage Arguments Details

View source: R/assert.R

Description

The primary key here is similar to the concept in relational DB. It means the key uniquely identifies each record in the table. It's an important attribute when x is an information table, which is later quried / merged against by other tables. A primary-keyed table can avoid duplicates in such cases.

Usage

1

Arguments

x

a data.table object

Details

Throws error unless x has a key, contains no NA values in key columns, and is unique for key values.


shrektan/dtkit documentation built on Nov. 26, 2021, 10:50 p.m.