From 4026ba47dd0f967aaa8ab1889b693fbd280fe505 Mon Sep 17 00:00:00 2001 From: Jari Oksanen Date: Thu, 18 Aug 2016 10:16:15 +0300 Subject: [PATCH] put back 'choices' that were accidentally dropped from goodness.cca choices were unintentionally dropped when goodness.cca was replaced with the new code (then goodness2.cca) in a231931c. They are still documented but won't work. There are many ways of doing this as discussed in issue #190 in github --- R/goodness.cca.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/R/goodness.cca.R b/R/goodness.cca.R index c21eb2fc3..da9d6fd76 100644 --- a/R/goodness.cca.R +++ b/R/goodness.cca.R @@ -20,6 +20,12 @@ ## imaginary dimensions for dbrda if (inherits(object, "dbrda")) CA <- cbind(CA, object[[model]][["imaginary.u"]]) + ## take only chosen axes within the component + if (!missing(choices)) { + choices <- choices[choices <= ncol(CA)] + CA <- CA[, choices, drop = FALSE] + eig <- eig[choices] + } att <- attributes(CA) if (inherits(object, "rda")) nr <- nobs(object) - 1