Closed hpages closed 2 years ago
For those who don't know the history, the background for this can be found in https://github.com/HenrikBengtsson/matrixStats/issues/183.
- I called colSds(), not colVars(), so it's strange that I get an error telling me that the latter is defunct.
Updated message to also mention colSds()
, cf.
- AFAIK colVars() is not defunct.
This was fixed in commit 389e3d1766bd256742c5d1300db80ba404aed788.
- The overall explanation given in the message is rather cryptic, especially the last sentence which seems to be missing something:
The reason was: Mean relative difference: 0.8455205' instead.
The stray "instead" was appended by .Defunct()
, which was automatically fixed by commit 389e3d1766bd256742c5d1300db80ba404aed788.
- I only get the error once. Subsequent calls work fine: ...
I've added (commit 32b7d795) a section to help("rowVars")
on how center
is validated and updated the error message too;
> library(matrixStats)
> m0 <- matrix(0, nrow=12, ncol=9)
> colSds(m0, center=-1:7)
Error: Detected incorrect use of argument 'center' for colVars() or colCols(). The value
of 'center' does not meet the assumption that estimating the variance using the 'primary'
or the 'alternative' formula does not matter as they should give the same results, which
suggests a misunderstanding on what argument 'center' should be. Please see
help("rowVars", package = "matrixStats"). The reason was: Mean relative difference: 2
(this validation is performed every 50 call to this function per R option
'matrixStats.vars.formula.freq')
I think the new error message might have a typo: "argument 'center' for colVars() or colCols"?
I think the new error message might have a typo: "argument 'center' for colVars() or colCols"?
Thanks for spotting this. Fixed.
Thanks Henrik.
Note that the matrixStats.vars.formula.freq
option does not seem to be working as advertised (I'm using matrixStats 0.62.0-9002):
library(matrixStats)
rowVars(matrix(1:12, nrow=4), center=11:14)
# Error: Detected incorrect use of argument 'center' for rowVars() or rowSds(). The value of 'center'
# does not meet the assumption that estimating the variance using the 'primary' or the 'alternative'
# formula does not matter as they should give the same results, which suggests a misunderstanding
# on what argument 'center' should be. Please see help("rowVars", package = "matrixStats").
# The reason was: Mean relative difference: 3.214286 (this validation is performed every 50 call to
# this function per R option 'matrixStats.vars.formula.freq')
getOption("matrixStats.vars.formula.freq")
# [1] 50
options(matrixStats.vars.formula.freq=2)
rowVars(matrix(1:12, nrow=4), center=11:14)
# [1] 70 70 70 70
rowVars(matrix(1:12, nrow=4), center=11:14)
# [1] 70 70 70 70
rowVars(matrix(1:12, nrow=4), center=11:14)
# [1] 70 70 70 70
rowVars(matrix(1:12, nrow=4), center=11:14)
# [1] 70 70 70 70
# etc...
the
matrixStats.vars.formula.freq
option does not seem to be working as advertised
There was a thinko in the code. It would indeed eventually acknowledge the new setting, but not until the previous one has completed a cycle (i.e. after 50 times). Fixed in commit 2c29e05
I don't think so but that's what the error message below says:
Several problems with this error message:
colSds()
, notcolVars()
, so it's strange that I get an error telling me that the latter is defunct.colVars()
is not defunct.Thanks, H.
sessionInfo():