intro_to_r_cheatsheet.md

A practical starter guide based on An Introduction to R by Mark Gardener.


โœ… Load R and Get Help

# Start R and use help
help.start()
?mean

๐Ÿ“Š Create a Simple Dataset

heights <- c(150, 160, 170, 165, 180)
weights <- c(55, 60, 72, 68, 80)

๐Ÿ“‰ Plot It

plot(heights, weights, main="Height vs Weight", xlab="Height (cm)", ylab="Weight (kg)")

๐Ÿ“š Run a Linear Model

lm_result <- lm(weights ~ heights)
summary(lm_result)