Open shy86 opened 1 year ago
In the function Krig.check.xY:
Krig.check.xY
if (na.rm) { ind <- is.na(Y) if(all(ind)){ stop("Oops! All Y values are missing!") } if (any(ind)) { Y <- Y[!ind] x <- as.matrix(x[!ind, ]) if (!is.null(Z)) { Z <- Z[!ind, ] <----------------- } weights <- weights[!ind] } }
In the function Krig.replicates:
Krig.replicates
else { rep.info.aov <- fast.1way(rep.info, out$y, out$weights) tauHat.pure.error <- sqrt(rep.info.aov$MSE) tauHat.rep <- tauHat.pure.error yM <- as.matrix(rep.info.aov$means) weightsM <- rep.info.aov$w.means xM <- as.matrix(out$x[uniquerows, ]) if (!is.null(out$Z)) { ZM <- as.matrix(out$Z[uniquerows, ]) <----------------- } else { ZM <- NULL } pure.ss <- rep.info.aov$SSE if (verbose) print(rep.info.aov) }
Krig.check.xY may return Z as a vector, which will trigger error of Krig.replicates, because Z is not a matrix.
Z
A simple solution is Z[!ind, , drop = FALSE]
Z[!ind, , drop = FALSE]
In the function
Krig.check.xY
:In the function
Krig.replicates
:Krig.check.xY
may return Z as a vector, which will trigger error ofKrig.replicates
, becauseZ
is not a matrix.A simple solution is
Z[!ind, , drop = FALSE]