我的同时声明中的"unexpected symbol"是什么?



我遇到了一个非常基本的R语句的问题:

while (count < 10) { print(count) count <- count + 1}
Error: unexpected symbol in "while (count < 10) { print(count) count"

错误的原因是什么?

通常,我会在多行上放置"不仅仅是简单的调用",如下所示:

while (count < 10) { 
    print(count) 
    count <- count + 1
}

这样可以让你做的事情更清楚,避免出现类似的问题。

最新更新