Skip to content

Commit

Permalink
vegan_wrapper 2 category doesn't do polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
jtclaypool committed May 9, 2017
1 parent 7e33109 commit d24e436
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/vegan_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ vegan_wrapper <- function(RA="relative abundance",meta="metadata",category_1="ca
if(labels){nmds_dat=nmds_dat[match(meta[,1],rownames(nmds_dat)),]}

if(!is.na(category_2)){
nmds_dat=cbind.data.frame(nmds_dat,"combined"=paste(meta[,category_1],meta[,category_2],sep="_"))
nmds_dat=cbind.data.frame(nmds_dat,"category_1"=meta[,category_1],"category_2"=meta[,category_2])
NMDS_plot <- ggplot(data = nmds_dat,aes(x=MDS1,y=MDS2))+
geom_polygon(data=nmds_dat,aes(fill=as.factor(combined)))+
geom_point(aes(fill=as.factor(combined)))
geom_point(aes(shape=as.factor(category_2),color=(as.factor(category_1))))
}
else{
NMDS_plot <- ggplot(data = nmds_dat,aes(x=MDS1,y=MDS2))+
Expand Down

0 comments on commit d24e436

Please sign in to comment.