Assignment 5

Wimpy Sample Data

Alex Sharp

9/18/2020

I am using water sample data that were collected from my research site in Northeast

Arkansas. The samples were collected from three groundwater monitoring wells and one

surface reservoir. Two .csv spreadsheets with water sample data will be used in R, one from

a sample date in February and one from March. The farmer of the land from which the samples

were collected is last named Wimpy, hence the use of the name throughout my code. The data

are composed of measured water quality data, such as concentrations of major cations and

anions, pH values, and water temperature. The data tables provide coordinates of latitude

and longitude for each Sample.ID, which I can use to create spatial objects.

library("plyr")
library("dplyr")  
library("sp")
library("sf")
library("readr")
library("data.table")

Wimpy Water Sample Data collected during the months of February and March

#load data
WimpySamples_Mar <- read.csv("data/Mar.csv", header = T)
WimpySamples_Feb <- read.csv("data/Feb.csv", header = T)

# I now have 2 data frames.

Merging February and March data frames

# I want my data contained in one single data.frame.
# Both data frames have the same variables, allowing me to join the two vertically, using the rbind() function: 
WimpyDF <- rbind(WimpySamples_Feb, WimpySamples_Mar)

str(WimpyDF)
# The data.frame contains 8 rows of observations of 41 columns of values of variables

Fitting a linear model of Temperature vs. DO COncentrations:

lm(Temp..C.~DO..mg.L., data = WimpyDF)

#> Call:

lm(formula = Temp..C. ~ DO..mg.L., data = WimpyDF)

Coefficients: (Intercept) DO..mg.L.
15.5750 -0.5438