From d24e43688dcc5b31bf43bceaef7c142699c48053 Mon Sep 17 00:00:00 2001 From: jtclaypool Date: Tue, 9 May 2017 16:33:43 -0700 Subject: [PATCH] vegan_wrapper 2 category doesn't do polygon --- R/vegan_wrapper.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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))+