# NOT RUN {
nycflights_dm <- dm_from_src(dplyr::src_df(pkg = "nycflights13"))
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 does not work (throws an error)
try(
nycflights_dm %>%
dm_add_pk(planes, manufacturer, check = TRUE)
)
dm_nycflights13() %>%
dm_rm_pk(airports, rm_referencing_fks = TRUE) %>%
dm_draw()
# }
Run the code above in your browser using DataLab