I have combine different values which means the same, under the variable "Wine_type"
Mock Neg Neg1PCR NegPBS red Red RedWine water Water white White
1 9 1 1 2 18 4 3 4 2 24
into
Mock Neg Neg1PCR NegPBS Redwine Water Whitewine
1 9 1 1 24 7 26
By using this code
dat2<- data.frame(sample_data(psdata.r), stringsAsFactors =FALSE )
dat2$Project<- as.character(dat2$Wine_type)
table(dat2$Project)
dat2[grepl("water|water", dat2$Project, ignore.case = TRUE), "Project"] <- "Water"
dat2[grepl("White|white", dat2$Project, ignore.case = TRUE), "Project"] <- "Whitewine"
dat2[grepl("red|Red", dat2$Project, ignore.case = TRUE), "Project"] <- "Red"
dat2[grepl("Red|Redwine", dat2$Project, ignore.case = TRUE), "Project"] <- "Redwine"
then i produce a plot by the code
plot_richness(psdata.r, measures = c("Observed","Shannon"), x = "Wine_type", color = "SampleType") + geom_boxplot()
the only problem is that i get a plot with the old values. What am i missing to use the new group together values?