Parallel processing 在ClusterR中获取错误:群集错误

Parallel processing 在ClusterR中获取错误:群集错误,parallel-processing,raster,gwr,Parallel Processing,Raster,Gwr,我试图指定用于运行地理加权回归的集群数量。我有一个由9个光栅组成的堆栈,这些光栅已转换为数据帧。我得到了下面的错误(在结尾)并且不确定如何解释错误,从我所能说的来看,一切看起来都是正确的。 示例df.notmissing: library(doParallel) library(foreach) library(raster) library(snow) library(spgwr) library(maptools) library(GW

我试图指定用于运行地理加权回归的集群数量。我有一个由9个光栅组成的堆栈,这些光栅已转换为数据帧。我得到了下面的错误(在结尾)并且不确定如何解释错误,从我所能说的来看,一切看起来都是正确的。 示例df.notmissing:

    library(doParallel)
    library(foreach)
    library(raster)
    library(snow)
    library(spgwr)
    library(maptools)
    library(GWmodel)
    library(e1071)
    library(sp)
我想使用spgwr库运行gwr。不带clusterR的gwr如下所示:

    #x         y       temperature distance_patches tpi impervious treecanopy ndvi   baylands  buildings percent_patches not_missing
    #-2254439 1895333          42              300 15.6         54       20.1 0.27    13000         4               0        TRUE
    #-2255904 1890878          41             1204 19.7         44       75.2 0.52    18000         0               0        TRUE
    #-2251748 1893330          43             1082  9.5         94       25.9 0.07    14000         6               0        TRUE
    #-2253093 1896021          43              224  9.6         46       20.7 0.29    12000         0               0        TRUE
    #-2249535 1892613          42              539 10.1         81       10.9 0.16    15000         0               0        TRUE
    #-2247891 1895483          43              949  5.9         89       21.7 0.30    12000         0               0        TRUE
    #-2244931 1893181          42              283  4.7         31       30.8 0.37    15000         0               0        TRUE
    #-2253751 1894466          42              500 15.2         38       25.7 0.38    14000         0               0        TRUE
    #-2257399 1897606          42              762 19.0         51       22.5 0.27    12000        25               0        TRUE
    #-2251808 1896858          45             1000  8.3         87        2.2 0.21    11000        35               0        TRUE

*为gwr()函数创建空间对象的步骤:坐标(df.notmissing)
     gwr.model <- gwr(temperature ~ treecanopy + tpi + impervious + treecanopy + ndvi + percent_patches + distance_patches + baylands + buildings, 
                      data=df.notmissing, 
                      #coords=cbind(x,y), # object is already a spatial object so don't need to specify coords in gwr function
                      adapt=0.5, 
                      bandwidth=300,
                      hatmatrix=TRUE, 
                      se.fit=TRUE)
    ncores <- detectCores()/2 # detectCores()-1 - number of cores to use if parallel processing
    gwr.formula <- temperature ~ treecanopy + tpi + impervious + treecanopy + ndvi + percent_patches + distance_patches + baylands + buildings

    beginCluster(ncores)
    gwr.model.cluster <- clusterR(x=rasterFromXYZ(df.notmissing[-12]), gwr, arg=list(formula= gwr.formula, data=as.data.frame(x,xy=TRUE), coords= x[1:2], adapt=0.5, bandwidth=300, hatmatrix=TRUE, se.fit=TRUE))
    endCluster()
    [1] "attempt to set 'colnames' on an object with less than two dimensions"
    attr(,"class")
    [1] "snow-try-error" "try-error"     
    Error in clusterR(x = rasterFromXYZ(df.notmissing[-12]), gwr, arg = list(formula =         gwr.formula,  : 
      cluster error