So this post asks us what AREN'T we using R for, and was an interesting read, but perhaps the opposite might be fun as well?
R is my DuctTape/WD40 all-in-one, a multitool that helps with all of life's problems... and if you are the same, then I invite you to write a post here about some of the weird applications.
I'll start us off. I have about 20-30 databases that need ODBC Source credentials to be installed on my computer, our server, and anyone who collaborates, even though all use different drivers (there are ways to query direct without saving sources in R, but not for Power BI which I use). Passing new credentials around was error-prone and annoying, so I wrote an ODBC handling repo consisting of two files:
ODBC-Exporter:
- The ODBC Sources are installed in my Registry (windows pc), so I export that part of the registry using
system('reg export "HKEY_CURRENT_USER\\Software\\ODBC" "export.reg" /y')
. - Using regex, I munge the code in a file called ODBC.ini (for the server, with it's different drivers and formatting), and another .reg file (for windows collaborators), ready to be shared.
- Use github to get stuff into the server, and for the next step for humans.
ODBC-Importer
- After someone has added/edited a source, pull the github repo, run the importer that will regexp the file until your drivers are listed correctly in the .reg file
- Double click the .reg file which imports all the sources and presto, you have a synchronized system!
This process even allows for a third script that exports a safe version of the ODBC sources (without any of the RW connections) for sharing with staff that doesn't need to be writing to the dbs!
Is this a hack? Yes. Is it awful and dangerous? Yes. Does it work and introduce order into an otherwise chaotic environment? Yes.
Now your turn!