A folding ruler, a glass thermometer, a kitchen scale and a sheet with a tally list on a black surface
a ruler, a thermometer, a scale and a tally sheet all measure, but what you may do with their numbers is not the same.
image: ai-generated (gpt-image-2.5-flare)

one row per game, one column per fact

an observation is one game, and a variable is one fact that can differ from game to game.

a variable varies

a fact that is the same in every game is a constant, and a constant needs no column.

types of variables

after Döring (2023), chapter 8.4

what each scale allows

each scale keeps everything the one above it allows and adds one more question you may ask.

door 3 is not three times door 1

a number used as a name is still a name, so count it instead of averaging it.

ten degrees are not twice as warm as five

ratios need a true zero, which a price has and a temperature in Celsius does not.

is a rating scale ordinal or interval?

if in doubt, compute both, and say which one you report.

every scale has its type in R

a factor is how R remembers that a column is categorical.

telling R what a column is

library(dplyr) monty_hall <- monty_hall |> mutate(decision = factor(decision, levels = c("stay", "switch"))) survey <- survey |> mutate(organic_share = factor(organic_share, levels = 1:5, ordered = TRUE))
factor() marks a column as nominal, ordered = TRUE as ordinal, and numbers stay double or integer.

what you may compute

the scale tells you which function makes sense, while R will run all of them anyway.
the scale of a variable decides what you may compute with it, and R's type should say so.