【发布时间】:2013-03-03 01:27:57
【问题描述】:
这是我正在使用的代码,在 Rstudio 中运行良好
a1 <- matrix(c(1601, 162527, 510, 412368), nrow=2, byrow=T)
chisq.test(a1, correct=F)
这是我得到的错误
! Undefined control sequence.
<argument> ^^M##^^M## Pearson'
s Chi-squared test^^M##^^M## data: a1^^M## X...
l.356 \end{verbatim}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
如果我这样做会起作用
c1 <- chisq.test(a1, correct=F)
然后使用
调用 p 值c1$p.value
是什么导致了这个问题?
【问题讨论】:
-
才发现你半年前问过同样的问题...
-
我认为另一个与重要代码有关,而这没有。
-
这两个问题都是由单引号引起的。我很理解你没有意识到这一点。我希望结束这个问题不是因为它不是一个好问题,而是为了避免重复答案。
-
@Yihui 如何关闭问题?直接删除?
-
@SaberCN,是的,这是一种可能性。作为原始发帖者,您应该会看到删除(或关闭)它的选项。