dupree
dupree copied to clipboard
Function for extracting a template of any duplicated code
Say these two code blocks are identified by dupree
my_code <- some_data %>%
a_really() %>%
long_pipeline() %>%
bespoke_function1()
.
.
.
some_data %>%
a_really %>%
long_pipeline() %>%
bespoke_function2()
Is there some way that dupree could take the details of these two code blocks (file / line) and return a template for abstracting out the common code?
new_function <- function(x) {
x %>% a_really() %>% long_pipeline()
}