diff --git a/DESCRIPTION b/DESCRIPTION index 3d3f5e66..90a0aa9c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: microViz Title: Microbiome Data Analysis and Visualization -Version: 0.12.5 +Version: 0.12.5.9000 Authors@R: person(given = "David", family = "Barnett", diff --git a/NEWS.md b/NEWS.md index 22e11e3a..283327c8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# microViz (development version) + # microViz 0.12.5 - Fix: tax_fix no longer allows min_length of 0, as empty strings are (and were) always replaced diff --git a/R/ord_plot.R b/R/ord_plot.R index 68d9239a..27ec865e 100644 --- a/R/ord_plot.R +++ b/R/ord_plot.R @@ -245,9 +245,11 @@ ord_plot <- ) axesLabs <- axesNames <- colnames(siteScoresDf) } else { - # compute summary of ordination object to ensure - # consistent scaling of components - ordsum <- summary(ordination, scaling = scaling, axes = max(axes)) + # get all scores of ordination, to ensure consistent scaling + ordsum <- vegan::scores( + x = ordination, scaling = scaling, + choices = seq_len(max(axes)), display = "all" + ) # retrieve scores from model object siteScoresDf <- as.data.frame(ordsum[["sites"]][, axes, drop = FALSE]) @@ -268,6 +270,7 @@ ord_plot <- axesNames <- colnames(siteScoresDf) axesLabs <- paste0(axesNames, " [", sprintf("%.1f", 100 * explainedVar), "%]") } + # bind ordination axes vectors to metadata subset for plotting df <- dplyr::bind_cols(siteScoresDf, meta)