Skip to main content

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:
  1. You donโ€™t need to manually set your working directoryโ€”itโ€™s handled for you.
  2. All of your scripts, data, and output files stay together.
  3. 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.