Created
August 7, 2017 19:01
-
-
Save ellisvalentiner/2fa6745126100c26d8b7b60eff1bd41a to your computer and use it in GitHub Desktop.
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
library(purrr) | |
library(dplyr) | |
library(tidyr) | |
deps <- readLines("~/Desktop/deps.txt") | |
df <- deps %>% | |
map(strsplit, split=": ") %>% | |
flatten %>% map_if(~length(.x) == 1L, ~c(.x, NA)) %>% | |
do.call(rbind.data.frame, .) | |
colnames(df) <- c("pkg", "dep") | |
brew_dependencies <- df %>% | |
mutate( | |
dep = stringr::str_split(dep, pattern = " ") | |
) %>% | |
unnest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment