Skip to content

Instantly share code, notes, and snippets.

@krlmlr
Created December 23, 2016 14:50
Show Gist options
  • Select an option

  • Save krlmlr/0eb3d7ee09ab9459757feb00b3e8c90e to your computer and use it in GitHub Desktop.

Select an option

Save krlmlr/0eb3d7ee09ab9459757feb00b3e8c90e to your computer and use it in GitHub Desktop.
Detect and manually fix missing join-by columns for dplyr
withCallingHandlers(
remake::make(remake::list_targets()),
message = function(e) {
if (grepl("Joining, ", e$message)) {
by_clause <- gsub("Joining(.*)\n", "\\1", e$message)
clipr::write_clip(by_clause)
srcref <- testthat:::find_first_srcref(sys.calls()[-1:-15])
srcfile <- attr(srcref, "srcfile")$filename
rstudioapi::navigateToFile(srcfile, srcref[1], srcref[2])
stop("Insert by clause: ", by_clause)
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment