CVlm {DAAG}:设置printit = FALSE会导致问题-未找到对象“加总" [英] CVlm {DAAG}: setting printit = FALSE causes an issue - object 'sumss' not found
问题描述
我正在使用 CVlm {DAAG}
,并且我想设置 printint = FALSE
,因为默认设置为
I am using the CVlm {DAAG}
and I wanted to set the printint=FALSE
since the default says
printit if TRUE, output is printed to the screen
我试图同时使用 plotit
和 printit
将函数运行为 FALSE
,但是随后我发现了错误: 找不到 sumss
变量 .
I tried to run the function with both plotit
and printit
to FALSE
but then I found the error: sumss
variable not found.
是否有一种方法可以将 printit
和 plotit
实际设置为 FALSE
,因为我不希望在打印机上打印图表或表格屏幕?
Is there a way to actually set the printit
and plotit
to FALSE
since I do not want the plot nor the table printed on the screen?
推荐答案
关于2015年9月3日更新的最新DAAG_1.22
放宽,您发现了 CVlm {DAAG}
的错误.我确定您已将 printit
和 plotit
都设置为 FALSE
,从而重现了该问题.考虑以下可重现的示例:
Relax, you have found a bug for CVlm {DAAG}
. I am sure you have set both printit
and plotit
to FALSE
, which reproduces the issue. Consider the following reproducible example:
library(DAAG)
CVlm(printit = FALSE) ## OK, plot generated, no ANOVA table printed
CVlm(plotit = FALSE) ## OK, ANOAV table printed, no plot generated
CVlm(printit = FALSE, plotit = FALSE) ## Oops...
# Error in CVlm(printit = FALSE, plotit = FALSE) : object 'sumss' not found
现在,快速扫描源代码可以发现问题所在.本地变量 sumss
在以下位置定义:
Now, a quick scan of the source code reveals the issue. Local variable sumss
is defined at:
if (printit | plotit) {
sumss <- 0
sumdf <- 0
## ...blablabla
}
即, printit
和 plotit
必须为 TRUE
才能声明和初始化 sumss
.但是,在 CVlm
的最后:
i.e., either printit
and plotit
needs be TRUE
to declare and initialize sumss
. However, in the very end of CVlm
:
attr(data, "ms") <- sumss/sumdf
attr(data, "df") <- sumdf
没有 if
条件来保护它们.因此,当您到达这些行时,会出现找不到变量"错误.
there is no if
condition to protect them. Therefore, when you reach those lines, you get "variable not found" error.
我不是软件包的创建者或维护者,所以我不热衷于解决此问题.我只是建议您保留 plotit = TRUE
.
I am not package author or maintainer so I am not keen on fixing this issue. I just suggest you to keep plotit = TRUE
.
我看到了您的新修改以澄清问题.如果您既不想打印也不想打印,则必须删除上面提到的两条 CVlm
函数.看来程序包作者并不热衷于维护此程序包,因此要求进行错误修复似乎很必要.
I saw your new edit to clarify the question. If you want neither plot nor print, you have to modify CVlm
function yourself, by removing the two attr
lines mentioned above. It looks like package author is not keen on maintaining this package, so asking for a bug fix seems desperate.
这篇关于CVlm {DAAG}:设置printit = FALSE会导致问题-未找到对象“加总"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!