#Case-1-------------------------------------
mdata<-matrix(c(8, 2, 2, 8), nrow=2, byrow=T)
rownames(mdata)<-c("A1","A2"); colnames(mdata)<-c("B1","B2")
mdata
fisher.test(mdata,alternative="greater")
#Case-2-------------------------------------
mdata<-matrix(c(8, 2, 8, 2), nrow=2, byrow=T)
rownames(mdata)<-c("A1","A2"); colnames(mdata)<-c("B1","B2")
mdata
fisher.test(mdata,alternative="greater")