Skip to content

Commit

Permalink
replace summary with scores with display = all - tests pass locally -…
Browse files Browse the repository at this point in the history
… vegan 2.6.8
  • Loading branch information
david-barnett committed Dec 15, 2024
1 parent a59b112 commit 4c53401
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 6 additions & 3 deletions R/ord_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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)

Expand Down

0 comments on commit 4c53401

Please sign in to comment.