require(XLConnect)
## Loading required package: XLConnect
## Loading required package: XLConnectJars
## XLConnect 0.2-11 by Mirai Solutions GmbH [aut],
##   Martin Studer [cre],
##   The Apache Software Foundation [ctb, cph] (Apache POI, Apache Commons
##     Codec),
##   Stephen Colebourne [ctb, cph] (Joda-Time Java library)
## http://www.mirai-solutions.com ,
## http://miraisolutions.wordpress.com
wb <- loadWorkbook("~m/Dropbox/LBH data/Additional data files/LBH bird ID account.xls", create = FALSE)
bird.ID<- readWorksheet(wb, sheet = "ID.account")

ter13<-with(bird.ID,table(Lek.2013,Territoriality.2013))[,3]
ter14<-with(bird.ID,table(Lek.2014,Territoriality.2014))[,2]

ter12<-with(bird.ID,table(Lek.2012,Territoriality.2012))[,2]


leks<-c("CCE","CCL","LOC","LSU","SAT","SJA","SUR")

#replace number of males in CCE 2014 by the ones in 2012
ter14[1]<-ter12[1]

Graph

Pearson correlation

## 
##  Pearson's product-moment correlation
## 
## data:  ter13[names(ter13) %in% leks] and ter14[names(ter14) %in% leks]
## t = 4.437, df = 5, p-value = 0.006784
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.4273192 0.9842030
## sample estimates:
##       cor 
## 0.8930101