From 3eee2c8d8403a3d4182689fa12d095dddfa303a3 Mon Sep 17 00:00:00 2001 From: Yanan Xin <7182055+zero31415@users.noreply.github.com> Date: Sun, 12 Mar 2023 23:17:13 +0100 Subject: [PATCH] Update gwr.mixed.r change the as.matrix function to the matrix function in line 121 to keep the right dimension of the matrix. as.matrix will produce a one-column matrix but here we need a matrix with one row. --- R/gwr.mixed.r | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/gwr.mixed.r b/R/gwr.mixed.r index 09c81e7..bd8214e 100644 --- a/R/gwr.mixed.r +++ b/R/gwr.mixed.r @@ -118,7 +118,7 @@ gwr.mixed <- function(formula, data, regression.points, fixed.vars,intercept.fix kernel=kernel, dMat=dMat, dMat.rp=dMat.rp) res <- list() res$local <- model$local - res$global <- as.matrix(apply(model$global,2,mean,na.rm=T), 1, length(idx.fixed)) + res$global <- matrix(apply(model$global,2,mean,na.rm=T), 1, length(idx.fixed)) colnames(res$local) <- colnames(x1) colnames(res$global) <- colnames(x2) mgwr.df <- data.frame(model$local, model$global) @@ -393,4 +393,4 @@ gwr.q.fast <- function(x, y, adaptive=F, bw, colnames(betas) <- colnames(x) betas -} \ No newline at end of file +}