Ryan Anthony Part 5 of AQ Assignment DATA 110

Load the Library

library(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.2     ✔ 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 the dataset into a global enviornment

data("BOD")

Structure of Dataset

head("BOD")
[1] "BOD"

Calculate Mean, Standard Deviation, and Variance

mean(BOD$Time)
[1] 3.666667
sd(BOD$demand)
[1] 4.630623
var(BOD$demand)
[1] 21.44267

Summary Statistic of BOD Dataset

summary(BOD$Time)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  1.000   2.250   3.500   3.667   4.750   7.000 

Plot 5 Code

ggplot(BOD, aes(x = Time, y = demand)) + geom_point() + geom_line() + labs(title = BOD, x = "Time (Days)", y = "Oxygen Demand")