Pipes and dplyr are useful for quick data exploration. Some argue that in a package, their use is not ideal.
In a package, I have to first add a package to the dependency.
Like this devtools::use_package("dplyr")
And than I have to prefix it with dplyr:: when I use any function.
How do I do that for the pipe operator? do I say: magrittr::%>%
?
I would ideally use in a package a code like this:
data %<>% group_by(a,b,c) %>% summarize(total=sum(d)) %>% ungroup()
Do I have to always say
data magrittr::%<>% dplyr::group_by(a,b,c) magrittr::%>% dplyr::summarize(total=sum(d)) %>% ungroup()
What is the best practice for pipes and dplyr in an R package?