Closed LTLA closed 4 years ago
Thanks. I'll fix before the next release
Reminder to self, this is still an issue. With the changes in https://github.com/HenrikBengtsson/matrixStats/issues/183 (not yet on CRAN) we're at least getting an error rather than a nonsense result:
set.seed(10000)
x <- matrix(runif(1000), ncol=10)
m <- colMeans(x)
suppressPackageStartupMessages(library(MatrixGenerics))
colVars(x, center=m)
#> [1] 0.08013967 0.09265077 0.08367831 0.09274660 0.08362152 0.10039803
#> [7] 0.08663035 0.07936689 0.08234544 0.07701829
suppressPackageStartupMessages(library(DelayedMatrixStats))
setAutoBlockSize(1000)
#> automatic block size set to 1000 bytes (was 1e+08)
colVars(DelayedArray(x), center=m)
#> [1] 0.08013967 0.09265077 0.08367831 0.09274660 0.08362152 0.10039803
#> [7] 0.08663035 0.07936689 0.08234544 0.07701829
colVars(DelayedArray(x) + 0, center=m)
#> Error in FUN(block, ...): Argument 'center' should be of the same length as number of rows of 'x': 10 != 1
Created on 2020-10-17 by the reprex package (v0.3.0)
Confirming fixed by #65 (using CRAN version of matrixStats)
set.seed(10000)
x <- matrix(runif(1000), ncol=10)
m <- colMeans(x)
suppressPackageStartupMessages(library(MatrixGenerics))
colVars(x, center=m)
#> [1] 0.08013967 0.09265077 0.08367831 0.09274660 0.08362152 0.10039803
#> [7] 0.08663035 0.07936689 0.08234544 0.07701829
suppressPackageStartupMessages(library(DelayedMatrixStats))
setAutoBlockSize(1000)
#> automatic block size set to 1000 bytes (was 1e+08)
colVars(DelayedArray(x), center=m)
#> [1] 0.08013967 0.09265077 0.08367831 0.09274660 0.08362152 0.10039803
#> [7] 0.08663035 0.07936689 0.08234544 0.07701829
colVars(DelayedArray(x) + 0, center=m)
#> [1] 0.08013967 0.09265077 0.08367831 0.09274660 0.08362152 0.10039803
#> [7] 0.08663035 0.07936689 0.08234544 0.07701829
Created on 2020-10-18 by the reprex package (v0.3.0)
Your
colblock_APPLY
statement fails to split the vectorcenter
in a corresponding manner to the blocks ofx
.