# Analysis of tree growth data
# Author: Selina Baldauf
# Date: 2026-03-09
library(tidyverse)
# set defaults
input_file <- "data/tree_growth.csv"
# read input
trees <- read_csv(input_file)
# analyse data
summary(trees)Day 1 - Introduction to Data Analysis with R
Freie Universität Berlin - Theoretical Ecology
March 16, 2026
… can make even small changes frustrating and difficult.
Consistent structure and filenames
README.md) in which you document the project structureAlways make your project an RStudio Project (if possible)!
✅ You already did that.
Your collaborators and your future self will love you for this.
File names should be
Names should allow for easy searching, grouping and extracting information from file names.
📄 2023-04-20 temperature göttingen.csv
📄 2023-04-20 rainfall göttingen.csv
📄 2023-04-20_temperature_goettingen.csv
📄 2023-04-20_rainfall_goettingen.csv
Which file names would you still understand in 1 year?
📄 01preparedata.R
📄 01firstscript.R
📄 01_prepare-data.R
📄 01_temperature-trend-analysis.R
If you order your files by name, the ordering should make sense:
01, 02, …)YYYY-MM-DD format📄 2023-04-20_temperature_goettingen.csv
📄 2023-04-21_temperature_goettingen.csv
📄 01_prepare-data.R
📄 02_lm-temperature-trend.R
Good practice R coding
library() calls on topCtrl/Cmd + Shift + Rsnake_case for longer variable namesTry to limit your line width to 80 characters.
Do I really have to remember all of this?
Luckily, no! R and R Studio provide some nice helpers
RStudio has style diagnostics that tell you where something is wrong
Tools -> Global Options -> Code -> Diagnostics
RStudio can automatically format your code!
Try it now: open your script from today and use Code -> Reformat Code to auto-format it.
… allow you and others to work productively.
But don’t get overwhelmed by all the advice. Just start with one thing.
Selina Baldauf // Good practice R coding