Last active
June 19, 2020 05:33
-
-
Save MilesMcBain/d7653e6e36b2a162605606fa2894b876 to your computer and use it in GitHub Desktop.
deps_target_recursive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deps_target_recursive <- function(target, plan){ | |
deps <- deps_target(target, plan = plan, character_only = TRUE) | |
target_itr <- function(deps, all_deps){ | |
new_deps <- | |
purrr::map_dfr(.x = deps$name, | |
.f = ~ drake:::deps_target_impl(.x, drake:::drake_config2(plan), character_only = TRUE)) %>% | |
distinct() | |
if(nrow(new_deps) == 0) all_deps | |
else target_itr(new_deps, bind_rows(all_deps, new_deps)) | |
} | |
target_itr(deps, tibble(name = character(0), type = character(0), hash = character(0))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment