This analysis looks at our recent crab surveys collected during Blue Recovery Beach Days. This work was inspired by recent conversations centered around the potential decline of shore crabs at the expense of Montagu’s crabs. Now we have collected some abundance data we will look at this issue and also ask some general questions about crab abundance across our survey sites.
In July, and in June in Plymouth, surveys were conducted separately for high shore and low shore. This is not the normal survey protocol but we thought it would make an interesting comparison. It does cause problems with the whole shore crab vs Montagu thing - because shore crabs tend to be higher up the shore. We’ll check this and we may have to do more data collection for that particular question.
I’ve added two spreadsheets to this repo, ‘Survey details.csv’ and ‘Species records.csv’. These are full versions of these data tables from our database as of the date of these files. I’ve avoided downloading the data in this code for data protection reasons.
Survey_details <- read.csv("Survey details.csv")
Survey_records <- read.csv("Species records.csv")
Site_info <- read.csv("Survey site info.csv")
Here we are only interested in ‘true crab’ surveys with abundance data. So we’ll subset the data accordingly.
TC_Survey_details <- subset(Survey_details, Survey.type == "BiodivTrueCrabs") #only True Crab surveys
TC_Survey_records_adund <- subset(Survey_records, Survey.ID %in% TC_Survey_details$Survey.ID & !is.na(Abundance)) #only records from True Crab surveys
TC_Survey_details_abund <- subset(TC_Survey_details, Survey.ID %in% TC_Survey_records_adund$Survey.ID) #only True Crab surveys with abundance data
table(TC_Survey_details_abund$Site) #number of surveys per site
##
## Castle Beach South Gylly North Gylly South Mount Batten South
## 4 3 2 2
Finally, as these data are collected in categories it would be useful to convert these categories into numbers. We can do this by creating a new ‘min_abund’ variable, based on the lower bound for each category.
TC_Survey_records_adund$min_abund <- NA #empty variable
#add the correct numbers for each category
TC_Survey_records_adund$min_abund[TC_Survey_records_adund$Abundance == "Single"] <- 1
TC_Survey_records_adund$min_abund[TC_Survey_records_adund$Abundance == "Rare <10"] <- 2
TC_Survey_records_adund$min_abund[TC_Survey_records_adund$Abundance == "Occasional <100"] <- 10
TC_Survey_records_adund$min_abund[TC_Survey_records_adund$Abundance == "Frequent <1000"] <- 100
TC_Survey_records_adund$min_abund[TC_Survey_records_adund$Abundance == "Common <10000"] <- 1000
TC_Survey_records_adund$min_abund[TC_Survey_records_adund$Abundance == "Abundant <100000"] <- 10000
TC_Survey_records_adund$min_abund[TC_Survey_records_adund$Abundance == "Super-Abundant 100000+"] <- 100000
sum(is.na(TC_Survey_records_adund$min_abund)) #check nothing was missed
## [1] 0
#add region to TC_Survey_details_abund
TC_Survey_details_abund$Region <- NA
#names for all Falmouth sites
fal_sites <- subset(Site_info, Region == "Falmouth")$Site
#names for all Plymouth sites
ply_sites <- subset(Site_info, Region == "Plymouth Sound")$Site
#Falmouth TC crab abund surveys
TC_Survey_details_abund$Region[TC_Survey_details_abund$Site %in% fal_sites] <- "Falmouth"
#Falmouth TC crab abund surveys
TC_Survey_details_abund$Region[TC_Survey_details_abund$Site %in% ply_sites] <- "Plymouth"
TC_Survey_details_abund$Region <- as.factor(TC_Survey_details_abund$Region)
#sum the total (minimum) number of crabs found in each survey
TC_Survey_details_abund$min_survey_abund <- NA
for (i in TC_Survey_details_abund$Survey.ID) {
TC_Survey_details_abund[TC_Survey_details_abund$Survey.ID == i,"min_survey_abund"] <- sum(subset(TC_Survey_records_adund, Survey.ID == i)$min_abund)
}
boxplot(min_survey_abund ~ Region, data = TC_Survey_details_abund, ylab = "Number of crabs per survey")
There are currently only two Plymouth surveys, both of which returned a minimum of 6 crabs. The current average for Falmouth surveys is 5 but there is a lot of variation.So nothing to see here. I’ll do a formal test though, just because I’ll use the same test technique elsewhere
#what is the diff between the number of crabs per survey between Falmouth and Plymouth?
emp_diff <- abs(median(subset(TC_Survey_details_abund, Region == "Falmouth")$min_survey_abund) - median(subset(TC_Survey_details_abund, Region == "Plymouth")$min_survey_abund))
#create 1000 random expectations
rand_diffs <- vector() #random results vector (empty)
for (i in 1:1000) {
ran_survey_dets <- TC_Survey_details_abund
ran_survey_dets$Region <- sample(ran_survey_dets$Region) #randomise the regions variable
#create random differance
this_rand_diff <- abs(median(subset(ran_survey_dets, Region == "Falmouth")$min_survey_abund) - median(subset(ran_survey_dets, Region == "Plymouth")$min_survey_abund))
#add to results vector
rand_diffs <- c(rand_diffs, this_rand_diff)
}
#plot the random results in a histogram
hist(rand_diffs, main = "Random differences between Falmouth and Plymouth", xlab = "Difference in number of crabs per survey")
#add empirical results as a red line
points(rep(emp_diff + 0.25, 2), c(0,300), type = "l", col = 2, lwd = 3)
#P Value
emp_P <- mean(emp_diff < rand_diffs)
emp_P
## [1] 0.783
So, as was blatantly obvious, nothing going on here.