The Number of Hexagons in each HEX_ID column:
bir <- read.csv("C:/Users/lance/OneDrive/Desktop/Ant 109/bird layer.csv")
mam <- read.csv("C:/Users/lance/OneDrive/Desktop/Ant 109/mammal layer.csv")
rep <- read.csv("C:/Users/lance/OneDrive/Desktop/Ant 109/reptile layer.csv")
length(unique(bir$Hex_ID))
## [1] 63890
#The number of Hexagons is 63890
length(unique(mam$Hex_ID))
## [1] 63890
#The number of Hexagons is 63890
length(unique(rep$Hex_ID))
## [1] 63890
#The number of Hexagons is 63890
#Merging the dataframes..
dataaa <- merge(rep, mam, by.x="Hex_ID", by.y="Hex_ID", all.x=T, all.y=T)
dat <- merge(dataaa, bir, by.x="Hex_ID", by.y="Hex_ID", all.x=T, all.y=T)
The code to create the histograms:
# 3 panel Graph of Distributions!
par(mfrow=c(1,3))
rept <-hist(dat$NtvRept, xlab = "reptiles",las=1, main = "Distribution of Reptiles", cex.main= 0.7, col = "seagreen1")
mamm <- hist(dat$NtvMamm, xlab = "mammmals",las=1, main = "Distribution of Mammals", cex.main= 0.7, col = "aquamarine2")
bird <- hist(dat$NtvBird, xlab = "birds",las=1, main = "Distribution of Birds", cex.main= 0.7, col = "lightgreen")
#3 panel graph with relationships!
#pairwise plots
par(mfrow=c(1,3))##1 row, 3 columns
plot(mamm, col = "mediumorchid1", main = "Distribution of Mammals vs Birds",xlim = c(0,250), ylim = c(0,18000), xlab = "mammals v.s birds")
plot(bird, col = "lightgreen", add = TRUE)
plot(mamm, col = "mediumorchid1", main = "Distribution of Mammals vs Reptiles",xlim = c(0,150), ylim = c(0,18000), xlab = "mammals v.s reptiles")
plot(rept, col = ("aquamarine"), add = TRUE)
plot(bird, col = "lightgreen", main = "Distribution of Birds vs Reptiles",xlim = c(0,250), ylim = c(0,18000), xlab = "Birds v.s reptiles")
plot(rept, col = "aquamarine", add = TRUE)
legend("right", title = "Legend", legend = c("Mammals", "Birds", "Reptiles"), col = c("mediumorchid1", "lightgreen", "aquamarine"), cex = .5, lwd = 1, pch = c(1,1))
The first plot visualizes the frequency of mammals and the frequency of birds in the state of California. We see that the density of mammals and birds are highest when the species counts are approximately 7,000 for birds and 13,000 for mammals. There are a greater number of birds throughout many different geographic boundaries than mammals- likely due to the the availability of habitat and hunting space.
The second plot shows that there are less geographic areas with high frequencies of reptiles than there are of mammals.This is likely due to the availability of habitat space and biome. There may also be sampling bias as reptiles are smaller and harder to catalogue.
The third plot shows that the geographic regions of California with a high frequency of reptiles are dwarfed by frequency and distribution of birds within the state. Birds have a greater habitat range and availability than reptiles.
knitr::include_graphics("C:/Users/lance/OneDrive/Desktop/Ant 109/b.jpeg")
This is a map of the density of bird species in the state of California. The highest species densities are on the western side of the Sierra Nevada Mountains, as well as in the Central valley, and in some spots along the coast. Species density is lowest in the Southeast desert regions of the state.