Appendix B — Glossary
A quick reference for terms used throughout this course, in alphabetical order. If you come across a word you don’t recognise while working through a session, check here first.
- Console
- The pane in RStudio where you type R code directly and see results immediately, without saving it to a file. Introduced in Overview of R and RStudio.
- CRAN (Comprehensive R Archive Network)
-
The main online repository of R packages. When you run
install.packages(), R usually downloads the package from CRAN. See R Packages and Libraries. - Data frame
- A table-like data structure where each column is a variable (and can be a different type) and each row is an observation – similar to a spreadsheet. See Data Frames and Lists.
- Environment
- The current collection of objects (variables, data frames, functions, etc.) that R has stored in memory for your session. Visible in RStudio’s Environment pane. See Overview of R and RStudio.
- Factor
- A data structure used to represent categorical data. A factor stores its values as a fixed set of categories, called levels. See Vectors and Factors.
- Function
-
A reusable piece of code that performs a specific task, e.g.
c(),mean(), orread_csv(). Functions take arguments (inputs) inside parentheses and usually return a result. - Level
- One of the distinct categories that a factor can take. For example, a factor for “fruit type” might have the levels “Apple”, “Banana”, and “Cherry”. See Vectors and Factors.
- Library
-
The folder on your computer where installed R packages are stored. Load a package from your library into your session with
library(). See R Packages and Libraries. - List
-
A flexible data structure that can hold elements of different types and lengths – including other lists (a nested list). Access elements with
[[ ]]or$. See Data Frames and Lists. - Object
- A general term for anything stored in R’s environment – a number, a vector, a data frame, a function, and so on. Every object has a name (its variable) and a value.
- Package
-
A bundle of functions, data, and documentation that extends R’s capabilities, e.g.
ggplot2orreadr. Install once withinstall.packages(), then load each session withlibrary(). See R Packages and Libraries. - Script
-
A plain-text file (
.R) containing only R code, with no narrative text. Compare with R Markdown. See R Markdown Basics. - Variable
-
The name you give to an object so you can refer to it later, e.g.
my_numberinmy_number <- 10. Created with the assignment operator<-. See Basic R Syntax and Operations. - Vector
-
An ordered collection of values that are all the same type (e.g. all numeric, or all character), created with
c(). The most basic data structure in R. See Vectors and Factors. - Working directory
-
The folder on your computer that R treats as its “home base” for the current session – relative file paths (like
"data/file.csv") are interpreted relative to this folder. Check it withgetwd()and set it withsetwd(). See R Markdown Basics.