University of Strathclyde
2025-11-04
RStudioRStudioImportant
R on your machine
RStudio on your machine
R software download
RStudio software download
R and RStudioR)tidyverseggplot2RMarkdownR is
R languageWhy use R?
RStudio is an integrated development environment (IDE)
Interactive Demo
Please start RStudio on your own machine
Variables are like named boxes
Name)Interactive Demo
Variable names are documentation
best practices
[a-zA-z0-9_.])x2 is allowed, 2x is not)Weight is not the same as weight)lower_snake, UPPER_SNAKE, lowerCamelCase, UpperCamelCaseWhat are functions?
log(), sin() etc.) ≈ “canned script”
sqrt(), lm(), plot())Note
RFigure 7: How projects often proceed…
THERE IS NO ONE TRUE WAY (only principles)
data?)clean_data?)R Projects (more advanced) https://chrisvoncsefalvay.com/2018/08/09/structuring-r-projects/Figure 8: An example working directory structure
Guidelines
README.txt fileRStudioRStudio can help you manage your projects
R Project concept - files and subdirectory structuregit)RStudioINTERACTIVE DEMO
Let’s create a project in RStudio
RStudio projects: https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects
IBioIC Carpentries Workshop