Question 1, there are 63890 hexagons represented for each of the three datasets provivded
library(readr)
data1 <- read_csv("bird layer.csv")
data2 <- read_csv("mammal layer.csv")
data3 <- read_csv("reptile layer.csv")
data1_s <- data1[order(data1$OBJECTID, decreasing = TRUE),]
num_hex_1 <- data1_s$OBJECTID[1]
data2_s = data2[order(data2$OBJECTID, decreasing = TRUE),]
num_hex_2 <- data2_s$OBJECTID[1]
data3_s = data3[order(data3$OBJECTID, decreasing = TRUE),]
num_hex_3 <- data3_s$OBJECTID[1]
print(num_hex_1)
## [1] 63890
print(num_hex_2)
## [1] 63890
print(num_hex_3)
## [1] 63890
Merging files together
part_m = merge(data1, data2, by = c("Hex_ID", "Eco_Sect", "Eco_Name",
"County", "Shape_Length", "Shape_Area"))
final_m = merge(part_m, data3, by= c("Hex_ID", "Eco_Sect", "Eco_Name",
"County", "Shape_Length", "Shape_Area"))
Distributions of the Birds, Mammals, and the Reptiles
par(mfrow=c(1,3))
bird_f = hist(x=data1$NtvBird,
freq = TRUE,
xlab = "Native Bird Per Hexagon",
main = "Distribution of Birds",
col = "red")
mammal_f = hist(x = data2$NtvMamm,
freq = TRUE,
xlab = "Native Mammal Per Hexagon",
main = "Distribution of Mammals",
col = "blue")
reptile_f = hist(x = data3$NtvRept,
freq = TRUE,
xlab = " Native Reptile Per Hexagon",
main = "Distrubtion of Reptiles",
col = "pink")
These Histograms show the number of active animals per hexagon in the x-axis, and the frequency on the y axis.
Relationships between the Birds, Mammals, and the Reptiles
par(mfrow=c(1,3), mai = c(0.5,0.5,1,0.25))
M_B = plot(x = final_m$NtvMamm,
y = final_m$NtvBird,
col = "brown",
pch = 12,
main = " Mammals and Birds per hexagon",
xlab = "Native Mammal Per Hexagon",
ylab = "Native Bird Per Hexagon",
bty = "l",
las = 1,
cex = 0.5,
xlim = c(0, max(final_m$NtvMamm)),
ylim = c(0, max(final_m$NtvBird)))
M_R = plot(x = final_m$NtvMamm,
y = final_m$NtvRept,
col = "purple",
pch = 12,
main = "Mammals and Reptiles per hexagon ",
xlab = "Native Mammal Per Hexagon",
ylab = "Native Reptile Per Hexagon",
bty = "o",
las = 1,
cex = 0.5)
B_R = plot( x = final_m$NtvBird,
y = final_m$NtvRept,
col = "red",
pch = 12,
main = "Birds and Reptiles per hexagon ",
xlab = "Native Bird Per Hexagon",
ylab = "Native Reptile Per Hexagon",
bty = "o",
las = 1,
cex = 0.5)
The plots above has the relationship between the populations of the animals given, in each hexagon
Question 2
The map here shows the richness of the native bird species in California, with regions that are shaped as hexagons, that divide the sections
The Richness of native birds is more noticeable on the coastal regions of California. The Richness is lower near the lower border of Nevada and California.