Organization source code
I may not be of much help here since I mostly worked in Python - but for my one R file I simply am using Git as the repository and history record. ".Rhistory" seems to record every line change - which seems like overkill to me except for undo/redo in R Studio.
So my 'organization':
--GIT history of changes
--Final report file includes list of scripts and their meaning
--Hopefully scripts are reasonably commented
After looking at it I don't think I would keep the '.Rhistory' file - just commit to Git often enough that if you mess up a file you can get an older copy and do a text comparison.
In my professional career, most of my colleagues discourage the use of .RHistory files in source control due to their potential size and persistent change. Most of our build engineers treat them the same as binaries and typically discourage their inclusion in our source control systems (GIT).
I am using a .R file and I have it organized to match my analysis process (which is how I am setting up my presentation).
I broke mine in sections: all packages used and loaded, data loaded and cleaned up, analysis, and results plus any visuals.
I added comments to break up each section and describe what is going on in each section with more emphasis in each step of analysis.
I will upload this to my GitHub once completed.
I am editing this file as I work through various packages that I try and am keeping it to what I am discussing in the presentation.
Hope this helps,
Organized scripts or R jupyter notebook are good. Uploading Rhistory directly isn't a good idea since there can be unnecessary commands: Instead, you may select necessary commands (in a correct order) from rhistory and copy & paste to your r script.