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
1
@@ -163,7 +163,7 @@ bars_fun <- function(data = data, rank = "Genus", top = 10, Ord1 = NULL, Fact1 =
for (i in 2:length(unique(meltdat[, Fact1]))) {
p1$x$layoutAttrs[[1]][[paste0("xaxis", i)]] = NULL
p1$x$layoutAttrs[[1]][[paste0("xaxis", i)]]$title <- paste0(Fact1,
p1$x$layoutAttrs[[1]][[paste0("xaxis", i)]]$title <- glue("{Fact1} = {unique(meltdat[, Fact1])[i]}")
}
return(p1)
}
Loading