.Rproj
Creating a project-oriented workflow in R
Humboldt-Universität zu Berlin
2024-05-06
Today we will…
here
4.4.0, “Puppy Cup”R.version
2023.12.1.402, “Ocean Storm”.Rproj file in a project folderSoSe2024 or Mastersarbeit
File > New Project > New Directory > New Project > [Directory name] > Create ProjectNew RProject
Create a new RProject for this course
File > New Project > New Directory > New Project > [Directory name] > Create Project.Rproj file and double-clickProject (None) drop-down (top right).Rproj
Tools > Global Options
Global settings
Change your Global Options so that
data: containing your dataset(s)scripts (or analyses, etc.): containing any analysis scriptsmanuscript: containing any write-ups of your resultsmaterials: containing relevant experiment materials (e.g., stimuli)data and scripts)data/raw sub-folderprocessed or tidy)scripts/New script
Create a new Quarto script:
File > New File > Quarto DocumentUse Visual Editor boxCreate
scripts/ folder: File > Save as...
readr::read_csv()
here-packagehere package (Müller, 2020) enables file referencing
setwd()
Figure 6: Illustration by Allison Horst
setwd()
If the first line of your R script is
setwd("C:\Users\jenny\path\that\only\I\have")I will come into your office and SET YOUR COMPUTER ON FIRE🔥.
here()
here
here::here()here functionhere function without loading the packageReproduce your analysis
Today we learned…
here ✅