> bkgd<-subsetPixels(zeroA, zeroA_ssc@model[["class"]]==1)
> bkgd_ssc <- spatialShrunkenCentroids(bkgd, r=1, s=2, k=8, weights = "gaussian")
calculating gaussian weights
calculating global centroid
initializing clusters with spatial k-means
fitting k = 8, s = 2
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 't': 'x' must be an array of at least two dimensions
> traceback()
25: h(simpleError(msg, call))
24: .handleSimpleError(function (cond)
.Internal(C_tryCatchHelper(addr, 1L, cond)), "'x' must be an array of at least two dimensions",
base::quote(base::colSums(x, na.rm = na.rm, dims = dims,
...)))
23: stop("'x' must be an array of at least two dimensions")
22: base::colSums(x, na.rm = na.rm, dims = dims, ...)
21: colSums(wi * d[nbi, ])
20: colSums(wi * d[nbi, ])
19: (function (nbi, wi)
colSums(wi * d[nbi, ])/sum(wi))(dots[[1L]][[2487L]], dots[[2L]][[2487L]])
18: mapply(FUN = FUN, ...)
17: eval(mc, env)
16: eval(mc, env)
15: eval(mc, env)
14: standardGeneric("mapply")
13: mapply(FUN, neighbors, wts)
12: t(mapply(FUN, neighbors, wts))
11: fx(seq_len(k))
10: nscentroids(x, y = y, s = s, distfun = distfun, priors = priors,
center = center, transpose = transpose, neighbors = neighbors,
neighbor.weights = wts, nchunks = nchunks, verbose = verbose,
BPPARAM = BPPARAM, ...)
9: .local(x, y, ...)
8: spatialShrunkenCentroids(x, y = y, r = r, s = si, priors = 1,
center = center, transpose = transpose, neighbors = neighbors,
weights = wts, nchunks = nchunks, verbose = FALSE, BPPARAM = BPPARAM,
...)
7: spatialShrunkenCentroids(x, y = y, r = r, s = si, priors = 1,
center = center, transpose = transpose, neighbors = neighbors,
weights = wts, nchunks = nchunks, verbose = FALSE, BPPARAM = BPPARAM,
...)
6: .local(x, ...)
5: spatialShrunkenCentroids(spectra(x), coord = coord(x), r = r,
k = k, s = s, neighbors = neighbors, weights = weights, transpose = TRUE,
...)
4: spatialShrunkenCentroids(spectra(x), coord = coord(x), r = r,
k = k, s = s, neighbors = neighbors, weights = weights, transpose = TRUE,
...)
3: .local(x, ...)
2: spatialShrunkenCentroids(bkgd, r = 1, s = 2, k = 8, weights = "gaussian")
1: spatialShrunkenCentroids(bkgd, r = 1, s = 2, k = 8, weights = "gaussian")
> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: AlmaLinux 9.4 (Seafoam Ocelot)
Matrix products: default
BLAS/LAPACK: /opt/rit/el9/20240413/app/linux-rhel9-x86_64_v3/gcc-11.3.1/openblas-0.3.26-vludctyfew6nfydjx3a3anpnpdey42df/lib/
libopenblasp-r0.3.26.so; LAPACK version 3.12.0
locale:
[1] LC_CTYPE=C.utf8 LC_NUMERIC=C LC_TIME=C.utf8 LC_COLLATE=C.utf8
[5] LC_MONETARY=C.utf8 LC_MESSAGES=C.utf8 LC_PAPER=C.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C.utf8 LC_IDENTIFICATION=C
time zone: UTC
tzcode source: internal
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] Cardinal_3.6.4 S4Vectors_0.42.1 BiocParallel_1.38.0 BiocGenerics_0.50.0
[5] ProtGenerics_1.36.0 BiocManager_1.30.23
loaded via a namespace (and not attached):
[1] nlme_3.1-165 cli_3.6.3 rlang_1.1.4 DBI_1.2.3 tiff_0.1-12
[6] png_0.1-8 RCurl_1.98-1.16 htmltools_0.5.8.1 ontologyIndex_2.12 Biobase_2.64.0
[11] locfit_1.5-9.10 grid_4.4.0 abind_1.4-5 bitops_1.0-8 fastmap_1.2.0
[16] compiler_4.4.0 codetools_0.2-20 CardinalIO_1.2.1 irlba_2.3.5.1 htmlwidgets_1.6.4
[21] fftwtools_0.9-11 EBImage_4.46.0 lattice_0.22-6 digest_0.6.36 matter_2.6.3
[26] parallel_4.4.0 Matrix_1.7-0 tools_4.4.0 jpeg_0.1-10 biglm_0.9-3