# NOT RUN {
nycflights_dm <- dm(
planes = nycflights13::planes,
airports = nycflights13::airports,
weather = nycflights13::weather
)
nycflights_dm %>%
dm_draw()
# Create primary keys:
nycflights_dm %>%
dm_add_pk(planes, tailnum) %>%
dm_add_pk(airports, faa, check = TRUE) %>%
dm_add_pk(weather, c(origin, time_hour)) %>%
dm_draw()
# Keys can be checked during creation:
try(
nycflights_dm %>%
dm_add_pk(planes, manufacturer, check = TRUE)
)
# }
Run the code above in your browser using DataLab