I am a data scientist and do lots of programming in R/RStudio.
I like to be organised (as I'm sure (hope) most programmers do) and as such I always use the Project feature in RStudio to keep my work organised so that I can comfortably switch between projects in just a couple of clicks, keeping related files together.
Due to the nature of my work, I regularly (daily) receive queries from colleagues about ad-hoc/random things that they wish to know about.
How I initially handled this was to write some code randomly, in the middle of my current script (yes, I know) in order to give them their answer, and then erase the code.
However, sometimes I simply forgot to remove the code due to distractions (we're all human) and it occasionally caused me to spend a bit of time analysing my code to detect where the error(s) occurred and rectify the problem.
As I found this to be a common problem (for me, at least), I decided to set up a Miscellaneous
R project for all such requests - I can simply switch to that project, script/calculate the person's request, give them the answer and then return to my other project. This removed the risk altogether of me negatively affecting existing projects and furthermore, I found that having a Miscellaneous
project also allows me to test code/models that I have built without it disrupting anything in any existing project workspaces.
I have searched online for advice around such things, and what the common approach to this is, but haven't found anything useful.
As such, my question is this: is creating a Miscellaneous
project for ad-hoc requests considered good practice? If not, what is the better/best way to handle such scenarios?