Skip to content

Commit

Permalink
Merge branch 'master' of github.com:microbiome/microbiome
Browse files Browse the repository at this point in the history
  • Loading branch information
antagomir committed Jul 18, 2022
2 parents ac5a78f + 08987fd commit 77dc9d7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions R/plot_composition.R
Expand Up @@ -134,9 +134,14 @@ plot_composition <- function(x,
dfm$Tax <- factor(dfm$Tax, levels=otu.sort)

if (!is.null(group_by)) {
dfm$Group <- meta(x)[[group_by]][match(as.character(dfm$Sample),
sample_names(x))]
}
if (!is.null(average_by)) {
dfm$Group <- meta(x)[[group_by]][match(as.character(dfm$Sample),
meta(x)[[average_by]])]
}else{
dfm$Group <- meta(x)[[group_by]][match(as.character(dfm$Sample),
sample_names(x))]
}
}

# SampleIDs for plotting
if (x.label %in% colnames(sample_data(x)) & is.null(average_by)) {
Expand Down Expand Up @@ -236,4 +241,4 @@ make_lineplot1 <- function (dfm) {

p

}
}

0 comments on commit 77dc9d7

Please sign in to comment.