Skip to content
Snippets Groups Projects

add an argument to bars_fun to split graph as facet_wrap

Merged Philippe Ruiz requested to merge (removed):Splitbars_fun into master
1 unresolved thread
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
+ 2
1
@@ -156,7 +156,8 @@ bars_fun <- function(data = data, rank = "Genus", top = 10, Ord1 = NULL, Fact1 =
showlegend = (.y == levels(meltdat[, Fact1])[1])),
keep = TRUE) %>%
subplot(nrows = 1, shareX = TRUE, shareY=TRUE, titleX = FALSE) %>%
layout(xaxis = list(title = paste0(Fact1, unique(meltdat[, Fact1])[1])),
layout(title=plottitle,
layout(title=plottitle, xaxis = list(title = glue("{Fact1} = {unique(meltdat[, Fact1])[1]}")),
yaxis = list(title = 'Relative abundance'),
barmode = 'stack')
Loading