Write functions. Functions with clear names that describe their purpose. Document them. Write tests.
Whether the functions contain sqldf
parts, or use dplyr
, or use bare R code, or call Rcpp
is at that level irrelevant.
But if you want to try changing something from sqldf
to dplyr
the important thing is that you have a stable platform on which to experiment, which means well-defined functions and a good set of tests. Maybe there's a bottleneck in one function that might run 100x faster if you do it with dplyr
? Great, you can profile and test the code with both.
You can even branch your code and have a sqldf
branch and a dplyr
branch in your revision control system (you are using an RCS, right?) and work in parallel until you get a winner.
It honestly doesn't matter if you are introducing other bits of syntax into your R code from a maintainability perspective if your codebase is well-documented and tested.