####################################################################################### #### Script for: A global database of soil seed bank richness, density and abundance ## #### Alistair Auffret et al. ########################################################## ####################################################################################### ## This script will open the global seed bank database, producing the values and information cited in the text and tables of the data descriptor. # Bring in data sb<-read.csv("gsb_db.csv") ############ # Abstract nrow(sb) # 3096 records length(unique(paste(sb$Lat_deg, sb$Lon_deg))) # 1929 locations length(unique(sb$StudyID)) # 1442 studies range(sb$Year) # 1940 - 2020. ############ # Intro nrow(sb) # 3096 records length(unique(sb$StudyID)) # 1442 studies sum(sb$Total_number_samples, na.rm=TRUE) # 1 081 363 sum(sb$Number_sites, na.rm=TRUE) # 15 899 sites length(unique(sb$Country)) # 94 countries ############ # Data entry sum(sb$Sample_depth_mm>=30, na.rm=TRUE)/sum(!is.na(sb$Sample_depth_mm)) # 94% of records at least 30 mm mean(sb$Sample_depth_mm, na.rm=TRUE) # mean sample depth 93 mm median(sb$Sample_depth_mm, na.rm=TRUE) # median sample depth 100 mm ############ # Database structure dim(sb) # 3096 records, 41 columns # Table 1 (Database description) names(sb) # column names # Table 2 (Biomes) - names and number of records table(sb$Biome) table(sb$Biome_broad) table(sb$Biome_zone) # Table 3 (Habitats) - names and number of records per category table(paste(sb$Habitat_current, sb$Habitat_target)) ############# # Figure 1 library(maps) # a package with simple maps transp<-function(col,alpha){ # a simple function to allow transparent plottning trans.col<-adjustcolor(col,alpha.f = alpha) return(trans.col)} # plot it map('world', col="lightgrey", fill=TRUE, lty=0, resolution=0) points(Lat_deg~Lon_deg, data=sb[sb$Habitat_current=="Arable",], col=transp("gold",0.5), pch=16, cex=0.5,lwd=0.5) points(Lat_deg~Lon_deg, data=sb[sb$Habitat_current=="Forest",], col=transp("forestgreen",0.5), pch=16, cex=0.5,lwd=0.5) points(Lat_deg~Lon_deg, data=sb[sb$Habitat_current=="Grassland",], col=transp("darkseagreen1",0.5), pch=16, cex=0.5,lwd=0.5) points(Lat_deg~Lon_deg, data=sb[sb$Habitat_current=="Wetland",], col=transp("skyblue3",0.5), pch=16, cex=0.5,lwd=0.5) points(Lat_deg~Lon_deg, data=sb[sb$Habitat_current=="Aquatic",],col=transp("navyblue",0.5), pch=16, cex=0.5,lwd=0.5) legend(-150,-20,c("Arable","Forest","Grassland","Wetland", "Aquatic"),pch=16,cex=0.75,col=c("gold", "forestgreen","darkseagreen1", "skyblue3","navyblue"),bty="n", pt.lwd=0.6) ############### # Create list of references of studies included in database sb$studylong<-paste(sb$Authors, sb$Year, sb$Title, sb$Journal, paste("doi:",sb$Doi),sep=", ") #cat(sort(unique(sb$studylong)),sep="\n\n", file="component_refs.txt") # write to file