.. _r_quick_reference: Quick Reference Table ------------------------------------------------- .. csv-table:: Common Tasks Quick Reference :header: "Task", "Function(s)", "Example" :widths: 25, 25, 50 :align: left "Import CSV", "``read.csv()``", "``d <- read.csv('data/AppRating.csv')``" "Check structure", "``str()``, ``head()``", "``str(d); head(d, 10)``" "Remove NAs", "``complete.cases()``", "``d_clean <- d[complete.cases(d), ]``" "Basic summary", "``summary()``", "``summary(d$score)``" "Create histogram", "``ggplot() + geom_histogram()``", "``ggplot(d, aes(x=score)) + geom_histogram()``" "One-sample t-test", "``t.test()``", "``t.test(d$score, mu = 3)``" "Two-sample t-test", "``t.test()``", "``t.test(score ~ platform, data = d)``" "One-way ANOVA", "``aov()``", "``fit <- aov(score ~ group, data = d)``" "Linear regression", "``lm()``", "``mod <- lm(rating ~ price, data = d)``" "Check residuals", "``plot()``", "``plot(mod, which = 1:2)``"