# Load in CSV ocean_acd <-read.csv("C:\\Users\\Admin\\OneDrive\\Documents\\Data & Vis in R\\Final_R_proj\\ocean-acidity_cln.csv")
Plots for pCO2
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 85 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 85 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 272 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 272 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 220 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 220 rows containing missing values or values outside the scale range
(`geom_point()`).
Plots for pH
Show the code
#pH plots h_plot <-ggplot(ocean_acd,aes(Hawaii.Year, Hawaii.pH))+geom_point(shape =21, color ='darkgreen', fill ='darkseagreen',size=3) +# Labelslabs(title ="Hawaii pH from 1989 - 2022",x ="Years",y ="pH")+geom_smooth(method ="lm") cI_plot <-ggplot(ocean_acd,aes(Canary.Islands.Year, Canary.Islands.pH))+geom_point(shape =21, color ='darkgreen', fill ='darkseagreen', size =3) +# Labelslabs(title ="Canary Islands pH from 1995 - 2009",x ="Years",y ="pH")+geom_smooth(method ="lm") b_plot<-ggplot(ocean_acd,aes(Bermuda.Year, Bermuda.pH))+geom_point(shape =21, color ='darkgreen', fill ='darkseagreen', size =3) +# Labelslabs(title ="Bermuda pH from 1983 - 2015",x ="Years",y ="pH")+geom_smooth(method ="lm") c_plot <-ggplot(ocean_acd,aes(Cariaco.Year..pH.,Cariaco.pH))+geom_point(shape =21, color ='darkgreen', fill ='darkseagreen', size =3) +# Labelslabs(title ="Cariaco pH from 1995 - 2017",x ="Years",y ="pH")+geom_smooth(method ="lm")plot_grid(h_plot,cI_plot,b_plot,c_plot)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 85 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 85 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 272 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 272 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 205 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 205 rows containing missing values or values outside the scale range
(`geom_point()`).
Source Code
---title: "Final project"author: "Christina Ebrahim"date: "2025-05-03"format: html: toc: true toc-location: left code-fold: true code-summary: "Show the code" code-tools: true---## setting up the packages ```{r setup, include=FALSE}#set the CRANoptions(repos = c(CRAN = "https://cloud.r-project.org"))# Load a list of packages. Install them first if they are not available.# The list of packages to be installedlist.of.packages <- c("sf", "sp", "spatial", "maptools", "rgeos","rgdal", "grid", "tidyverse", "magrittr", "ggpubr", "lubridate", "devtools", "htmlwidgets", "mapview", "classInt", "RColorBrewer", "ggmap", "tmap", "leaflet", "mapview", "ggrepel", "ggsn", "spdep","spatialreg","GWmodel","cowplot")# Check out the packages that have not been installed yet.new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]# Install those missing packages first. It could take a long time for the first time.if(length(new.packages)>0) install.packages(new.packages)# Load all packages.lapply(list.of.packages,function(x) { require(x,character.only = TRUE,quietly = TRUE)})```## Reading in the data ```{r Data}# Load in CSV ocean_acd <- read.csv("C:\\Users\\Admin\\OneDrive\\Documents\\Data & Vis in R\\Final_R_proj\\ocean-acidity_cln.csv")```## Plots for pCO2```{r pCO2 Plots, echo=FALSE}## pCO2 ho2plot<- ggplot(ocean_acd,aes(Hawaii.Year, Hawaii.pCO2))+ geom_point(shape = 21, color = 'darkgray', fill = 'darkblue', size= 3) + # Labels labs(title = "Hawaii pCO2 from 1989-2022", x = "Years", y = "pC02")+ geom_smooth(method = "lm", color="red")cIo2plot <- ggplot(ocean_acd,aes(Canary.Islands.Year, Canary.Islands.pCO2))+ geom_point(shape = 21, color = 'darkgray', fill = 'darkblue', size = 3) + # Labels labs(title = "Canary Islands pCO2 from 1955-2009", x = "Years", y = "pC02")+ geom_smooth(method = "lm", color="red")b02plot <- ggplot(ocean_acd,aes(Bermuda.Year, Bermuda.pCO2))+ geom_point(shape = 21, color = 'darkgray', fill = 'darkblue', size = 3) + #Labels labs(title = "Bermuda pCO2 from 1983-2015", x = "Years", y = "pC02")+ geom_smooth(method = "lm", color="red")co2plot<- ggplot(ocean_acd,aes(Cariaco.Year..pCO2.,Cariaco.pCO2))+ geom_point(shape = 21, color = 'darkgray', fill = 'darkblue', size = 3) + # Labels labs(title = "Bermuda pCO2 from 1955 - 2017", x = "Years", y = "pC02")+ geom_smooth(method = "lm", color="red")plot_grid(ho2plot,cIo2plot,b02plot,co2plot)```## Plots for pH```{r pH plots}#pH plots h_plot <-ggplot(ocean_acd,aes(Hawaii.Year, Hawaii.pH))+ geom_point(shape = 21, color = 'darkgreen', fill = 'darkseagreen', size= 3) +# Labelslabs(title = "Hawaii pH from 1989 - 2022", x = "Years", y = "pH")+ geom_smooth(method = "lm") cI_plot <-ggplot(ocean_acd,aes(Canary.Islands.Year, Canary.Islands.pH))+ geom_point(shape = 21, color = 'darkgreen', fill = 'darkseagreen', size = 3) + # Labels labs(title = "Canary Islands pH from 1995 - 2009", x = "Years", y = "pH")+ geom_smooth(method = "lm") b_plot<-ggplot(ocean_acd,aes(Bermuda.Year, Bermuda.pH))+ geom_point(shape = 21, color = 'darkgreen', fill = 'darkseagreen', size = 3) + # Labels labs(title = "Bermuda pH from 1983 - 2015", x = "Years", y = "pH")+ geom_smooth(method = "lm") c_plot <- ggplot(ocean_acd,aes(Cariaco.Year..pH.,Cariaco.pH))+ geom_point(shape = 21, color = 'darkgreen', fill = 'darkseagreen', size = 3) + # Labels labs(title = "Cariaco pH from 1995 - 2017", x = "Years", y = "pH")+ geom_smooth(method = "lm")plot_grid(h_plot,cI_plot,b_plot,c_plot)```