ConVsHet4R <- read.csv("~/Desktop/R stuff/ConVsHet4R.csv") bark<-ConVsHet4R$X.Bark cardboard<-ConVsHet4R$X.Cardboard coconut<-ConVsHet4R$X.Coconut plant<-ConVsHet4R$X.Plant shell<-ConVsHet4R$X.Shell wall<-ConVsHet4R$X.Wall mo<-rbind(bark,cardboard,coconut,plant,shell,wall) dimnames(mo)<-list(c("bark","cardboard", "coconut", "plant", "shell", "wall"), rep(c("G.oceanica","H.frenatus","L.lugubris"), 2)) chisq.test(mo) barplot(mo, beside=TRUE) #Con G.oceanica vs hetero G.oceanica go<-mo[,c(1,4)] chisq.test(go) barplot(go, beside = TRUE) #Con H.frenatus vs hetero H.frenatus hf<-mo[,c(2,5)] chisq.test(hf) barplot(hf, beside = TRUE) #Con L.lugubris vs L.lugubris ll<-mo[,c(3,6)] chisq.test(ll) barplot(ll, beside=TRUE)