This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
R.version
## _
## platform aarch64-apple-darwin20
## arch aarch64
## os darwin20
## system aarch64, darwin20
## status
## major 4
## minor 5.2
## year 2025
## month 10
## day 31
## svn rev 88974
## language R
## version.string R version 4.5.2 (2025-10-31)
## nickname [Not] Part in a Rumble
required_packages <- c(
"tidyverse", "rmarkdown", "knitr", "ggplot2", "dplyr",
"car", "lmtest", "sandwich", "stargazer", "broom"
)
installed <- sapply(required_packages, require, character.only = TRUE)
## Loading required package: tidyverse
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.6
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.1 ✔ tibble 3.3.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.2
## ✔ purrr 1.2.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
## Loading required package: rmarkdown
##
## Loading required package: knitr
##
## Loading required package: car
##
## Loading required package: carData
##
##
## Attaching package: 'car'
##
##
## The following object is masked from 'package:dplyr':
##
## recode
##
##
## The following object is masked from 'package:purrr':
##
## some
##
##
## Loading required package: lmtest
##
## Loading required package: zoo
##
##
## Attaching package: 'zoo'
##
##
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
##
## Loading required package: sandwich
##
## Loading required package: stargazer
##
##
## Please cite as:
##
##
## Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##
## R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
##
##
## Loading required package: broom
installed
## tidyverse rmarkdown knitr ggplot2 dplyr car lmtest sandwich
## TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## stargazer broom
## TRUE TRUE
install.packages(c(
"tidyverse", "rmarkdown", "knitr", "ggplot2", "dplyr",
"car", "lmtest", "sandwich", "stargazer", "broom"
))
dir.create("data", showWarnings = FALSE)
dir.create("scripts", showWarnings = FALSE)
dir.create("outputs", showWarnings = FALSE)
dir.create("figures", showWarnings = FALSE)
list.files()
## [1] "Applications"
## [2] "Beru_Isaac_Setup_Checklist.Rmd .Rmd"
## [3] "Beru_Isaac_Setup_Checklist.Rmd-.html"
## [4] "Beru_Isaac_Setup_Checklist.Rmd-.Rmd"
## [5] "data"
## [6] "Desktop"
## [7] "Documents"
## [8] "Downloads"
## [9] "figures"
## [10] "Library"
## [11] "Movies"
## [12] "Music"
## [13] "outputs"
## [14] "Pictures"
## [15] "Public"
## [16] "scripts"
## [17] "University at Albany - SUNY"
library(ggplot2)
data(mtcars)
ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
labs(
title = "Miles Per Gallon vs Weight",
x = "Weight (1000 lbs)",
y = "Miles Per Gallon"
)
## `geom_smooth()` using formula = 'y ~ x'
model <- lm(mpg ~ wt, data = mtcars)
summary(model)
##
## Call:
## lm(formula = mpg ~ wt, data = mtcars)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.5432 -2.3647 -0.1252 1.4096 6.8727
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 37.2851 1.8776 19.858 < 2e-16 ***
## wt -5.3445 0.5591 -9.559 1.29e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.046 on 30 degrees of freedom
## Multiple R-squared: 0.7528, Adjusted R-squared: 0.7446
## F-statistic: 91.38 on 1 and 30 DF, p-value: 1.294e-10
I ran a mini-analysis using the mtcars dataset by creating a scatterplot of mpg vs wt and fitting a linear regression model (mpg ~ wt). The results indicate a negative relationship: heavier cars tend to have lower miles per gallon.
This checklist confirmed my R/RStudio setup is working, my required packages load correctly, and I can knit an R Markdown file to HTML. I also created a basic project folder structure and practiced a simple analysis workflow that I’ll use throughout the semester.