4 months ago by
R has a history() command that will return the commands you’ve run to the console or a text file. I recommend working in RStudio where you can write a “script” and run lines from it so what you did is saved as you go.
It’s your thesis or paper so up to you but I’d consider digital supplementary data if you have a lot of code (GitHub repo or CD). If anyone wants to reproduce the code then it will be easier for them as well. Of course, check with your supervisor and collaborators to make sure they’re okay with releasing this. An R package to run any new functions you’ve made would also be helpful but this is more effort so isn’t always expected.
Make sure to list the versions of the packages you used as well from sessionInfo() and cite appropriately. Setting up the right packages is just as important for reproducibility.