intro_to_r_cheatsheet.md
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)