Section 1.13 ๐ก Reproducibility Tip:
Just like how your room can get messy without even trying, so can your work in R. You might start with a single R script, but soon there are multiple scripts, datasets, and figuresโmaybe one script accidentally saved in your Downloads folder while everything else lives somewhere else. Before you realize it, things feel chaotic.
One of the easiest ways to prevent this is by using R Projects.
To create a new R Project, go to File โ New Project, choose a location on your computer, and give it a meaningful name. From that point on, everything related to that project lives in one place.
The benefits of using an R Project include:
-
You donโt need to manually set your working directoryโitโs handled for you.
-
All of your scripts, data, and output files stay together.
-
Different projects remain cleanly separated, reducing confusion and mistakes.
In RStudio, you can check whether youโre working inside a project by looking at the top-right corner. If it says Project (None), youโre not in one. If it shows a project name, you are.
Developing the habit of using R Projects early will save you time, reduce errors, and make your work far easier to reproduceโboth for yourself and for others.
