diff --git a/R/vegan_wrapper.R b/R/vegan_wrapper.R index adfd90b..8415d37 100644 --- a/R/vegan_wrapper.R +++ b/R/vegan_wrapper.R @@ -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))+