# NOT RUN {
nycflights_dm <- dm(
planes = nycflights13::planes,
airports = nycflights13::airports
)
nycflights_dm %>%
dm_draw()
# the following works
nycflights_dm %>%
dm_add_pk(planes, tailnum) %>%
dm_add_pk(airports, faa, check = TRUE) %>%
dm_draw()
# the following throws an error:
try(
nycflights_dm %>%
dm_add_pk(planes, manufacturer, check = TRUE)
)
# }
# NOT RUN {
dm_nycflights13() %>%
dm_rm_pk(airports, rm_referencing_fks = TRUE) %>%
dm_draw()
# }
Run the code above in your browser using DataLab