Learn R Programming

dm (version 0.0.6.9000)

enum_pk_candidates: Which columns are candidates for a primary key column?

Description

enum_pk_candidates() checks for each column of a table if the column contains only unique values, and is thus a suitable candidate for a primary key of the table.

dm_enum_pk_candidates() performs these checks for a table in a dm object.

Usage

enum_pk_candidates(table)

dm_enum_pk_candidates(dm, table)

Arguments

table

A table in the dm.

dm

A dm object.

Value

A tibble with the following columns:

columns

columns of table,

candidate

boolean: are these columns a candidate for a primary key,

why

if not a candidate for a primary key column, explanation for this.

See Also

Other primary key functions: dm_add_pk(), dm_get_all_pks(), dm_get_pk(), dm_has_pk()

Examples

Run this code
# NOT RUN {
nycflights13::flights %>% enum_pk_candidates()

dm_nycflights13() %>% dm_enum_pk_candidates(flights)
dm_nycflights13() %>% dm_enum_pk_candidates(airports)
# }

Run the code above in your browser using DataLab