Skip to content

Commit

Permalink
Merge branch 'qrX-pivot'
Browse files Browse the repository at this point in the history
  • Loading branch information
jarioksa committed Mar 13, 2024
2 parents ef9dd75 + 58236af commit a88584b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/intersetcor.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
if (is.null(object$CCA) || !object$CCA$rank)
stop("no constrained ordination or rank of constraints is zero")
wa <- object$CCA$wa
X <- qr.X(object$CCA$QR)
X <- qr.X(object$CCA$QR, ncol = length(object$CCA$QR$pivot))
## remove conditions (partial terms)
if (!is.null(object$pCCA)) {
X <- X[, -seq_along(object$pCCA$envcentre), drop = FALSE]
Expand Down
4 changes: 2 additions & 2 deletions R/vif.cca.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
`vif.cca` <-
function(object)
function(object)
{
if (is.null(object$CCA))
stop("can be used only with constrained ordination")
Expand All @@ -8,7 +8,7 @@
names(out)[Q$pivot] <- colnames(Q$qr)
rank <- Q$rank
V <- chol2inv(Q$qr, size = rank)
X <- qr.X(Q)[, Q$pivot[1:rank], drop=FALSE]
X <- qr.X(Q, ncol = length(Q$pivot))[, Q$pivot[1:rank], drop=FALSE]
Vi <- crossprod(X)
v1 <- diag(V)
v2 <- diag(Vi)
Expand Down

0 comments on commit a88584b

Please sign in to comment.