Skip to content

Instantly share code, notes, and snippets.

@dgrtwo
Created June 29, 2015 15:01
Show Gist options
  • Save dgrtwo/0fb1df887c0ec55e8ea6 to your computer and use it in GitHub Desktop.
Save dgrtwo/0fb1df887c0ec55e8ea6 to your computer and use it in GitHub Desktop.
Script for turning "pipes" data from predpipe into a tidy data frame
library(plyr)
library(dplyr)
library(tidyr)
library(reshape2)
library(predpipe)
pipes_tidy <- pipes %>%
ldply(melt, .id = "path") %>%
rename(func = value, chain = L1) %>%
separate(path, c("package", "folder", "file"), "\\/", extra = "merge") %>%
group_by(package, folder, file, chain) %>%
mutate(position = row_number())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment