This document contains replication code and a dataset to accompany the manuscript “Birds and beans: Comparing avian richness and endemism in arabica and robusta plantations in India’s Western Ghats” by Charlotte H. Chang, Krithi K. Karanth, and Paul Robbins.
The central question addressed by this dataset is whether or not habitat specialist birds (forest-dependent, endemic, and IUCN Red-Listed species) exhibit different responses to Coffea arabica and Coffea canephora (robusta strain) plantations. Regional and global trends indicate that robusta production may be increasing at the cost of arabica, and this change may have biodiversity consequences as robusta is typically grown under full-sun, open habitat management, while arabica is more often shade-grown.
In this analysis, one can replicate habitat specialist individual-based rarefaction, asymptotic richness estimates, ordination, and distance-sampling abundance modeling.
Below, we load the Rdata containing the replication datasets. A description of each vector or dataframe is below:
FD.anon
: a vector of the column IDs for which species are forest-dependentED.anon
: a vector of column IDs for endemic species to IndiaIUCNbirds
: a vector of column IDs for IUCN Red-Listed speciescoffee.SR.anon
: a data frame with counts for bird species across multiple estates with multiple replicatesFD.ds
: an R object from package Distance
for forest-dependent bird abundanceEnd.ds
: Endemic abundance from package Distance
IUCN.ds
: IUCN Red-Listed species abundance from package Distance
###==================================================
### Load diversity data
###==================================================
## File download from GitHub repository - uncomment (remove leading hash) to run these two commands (which you only need to do once).
# githubURL <- "https://raw.github.com/charlottehchang/WCS-India-Coffee/master/WCS_Archiving.Rdata"
# download.file(githubURL,"WCS_Archiving.Rdata")
load("WCS_Archiving.Rdata") # make sure the path to the downloaded Rdata archive is correct--currently the download is in the same working directory as this script.
ls() # This shows you what is now contained in the workspace
## [1] "coffee.SR.anon" "ED.anon" "End.ds" "FD.anon"
## [5] "FD.ds" "IUCN.anon" "IUCN.ds"
###==================================================
### Estimate asymptotic richness
###==================================================
# If you do not have this package, please first use the command:
# install.packages(vegan) # Remove the leading hash to run this command
library('vegan') # load the vegan package and its functions
## Loading required package: permute
## Loading required package: lattice
## This is vegan 2.4-1
# Forest dependent analysis
print("Forest dependent species richness in arabica and robusta:")
## [1] "Forest dependent species richness in arabica and robusta:"
pool <- specpool(coffee.SR.anon[,FD.anon],coffee.SR.anon$Crop)
pool
## Species chao chao.se jack1 jack1.se jack2 boot
## Arabica 74 88.00509 10.3463570 86.92778 3.852901 93.88315 79.74846
## Robusta 66 66.33154 0.7547849 67.98925 1.406610 64.06434 67.79705
## boot.se n
## Arabica 2.132692 180
## Robusta 1.173085 186
## IUCN Red-listed species richness
print("IUCN Red Listed richness in arabica and robusta:")
## [1] "IUCN Red Listed richness in arabica and robusta:"
pool2 <- specpool(coffee.SR.anon[,IUCN.anon],coffee.SR.anon$Crop)
pool2
## Species chao chao.se jack1 jack1.se jack2 boot boot.se n
## Arabica 3 3 0 3 0 3 3 1.311930e-57 180
## Robusta 3 3 0 3 0 3 3 1.991371e-111 186
## Endemics
print("Endemic richness in arabica and robusta:")
## [1] "Endemic richness in arabica and robusta:"
pool3 <- specpool(coffee.SR.anon[,ED.anon],coffee.SR.anon$Crop)
pool3
## Species chao chao.se jack1 jack1.se jack2 boot
## Arabica 14 20.21528 7.512247 18.97222 2.223645 21.94994 16.10231
## Robusta 11 11.00000 0.000000 11.00000 0.000000 9.03220 11.30508
## boot.se n
## Arabica 1.1690611 180
## Robusta 0.5243744 186
###==================================================
# ECOLOGICAL ANALYSES: INDIVIDUAL BASED RAREFACTION
###==================================================
# Run commands of the following variety below:
Rare.FD <- specaccum(coffee.SR.anon[coffee.SR.anon$Crop=="Arabica",FD.anon],method="rarefaction")
plot(Rare.FD, xlab="Individual count",xvar="individuals",ylab="Rarefied richness")
###==================================================
# ECOLOGICAL ANALYSES: ORDINATION
###==================================================
### Performing ordination
# Repeat for ED.anon for endemics if so desired.
# Calculate CCA
FD.CCA <- cca(coffee.SR.anon[,c(FD.anon)]~Crop, coffee.SR.anon)
# Plotting example
plot(FD.CCA, type="points", xlim=c(-2,2), ylim=c(-2,2), display="species", scaling="species")
###==================================================
# ECOLOGICAL ANALYSES: ABUNDANCE VIA DISTANCE
###==================================================
ha.m2 <- 10000 # converting hectares to meters-square
## Obtaining statistics from Distance analysis (package 'Distance' in R)
print("Forest dependent individual average detection:")
## [1] "Forest dependent individual average detection:"
FD.ds$dht$individuals$average.p
## [1] 0.0933786
print("Forest dependent cluster average detection:")
## [1] "Forest dependent cluster average detection:"
FD.ds$dht$clusters$average.p
## [1] 0.1399554
## Obtaining individual bird densities
print("Range of FD individual densities across arabica versus robusta estates:")
## [1] "Range of FD individual densities across arabica versus robusta estates:"
print("Arabica range:")
## [1] "Arabica range:"
round(range(FD.ds$dht$individuals$bysample$Dhat[FD.ds$dht$individuals$bysample$Region=="Arabica"]*ha.m2),2)
## [1] 0.38 48.69
print("Robusta range:")
## [1] "Robusta range:"
round(range(FD.ds$dht$individuals$bysample$Dhat[FD.ds$dht$individuals$bysample$Region=="Robusta"]*ha.m2),2)
## [1] 0.38 28.27
## Obtaining flock size
# Cluster sizes
print("Forest dependent cluster sizes")
## [1] "Forest dependent cluster sizes"
FD.ds$dht$Expected.S
## Region Expected.S se.Expected.S
## 1 Arabica 1.535362 0.04194179
## 2 Robusta 1.457918 0.03300256
## 3 Total 1.498419 0.02714972