Professional Documents
Culture Documents
Assignment 2
Assignment 2
Arshya Pooladi-Darvish
2022-07-19
data<-read.csv("/Users/arshyapooladi-darvish/Downloads/assignment.csv")
df<-data.frame(data)
#Importing the csv file and creating a data frame
PART A
attach(df)
library(ggplot2)
#Plotting Average Pb in surfaces of playgrounds and Distance from a Roadway
ggplot(df, aes(x=distance, y=avgPb, shape=type, color=type)) + geom_point(size=4, shape=20)
300
type
200
mulch
avgPb
rubber
sand
soil
100
0
0 100 200
distance
PART B On average, the distance from a roadway has no correlation to the amount of lead in the present
in a playground. The slope of each surfacing type against distance from roadway the slope is very close to
0 for all surfacing types. Next, the differences in the type of surfacing between rubber and the other types
1
does not show a conclusive difference in average levels of lead. The levels of lead in the rubber was close to
those of sand and mulch while the levels of lead in soil varied a lot.