Brad Lindblad takes us through building a custom package in R:
Don’t repeat yourself (DRY) is a well-known maxim in software development, and most R programmers follow this rule and build functions to avoid duplicating code. But how often do you:
– Reference the same dataset in different analyses
– Create the same ODBC connection to a database
– Tinker with the same colors and themes in ggplot
– Produce markdown docs from the same templateand so on? Notice a pattern? The word “same” is sprinkled in each bullet point. I smell an opportunity to apply DRY!
This is a good point: packages don’t have to go out to the broader world. They’re useful even if they just help you (or your team) out. H/T R-bloggers
Comments closed