错误:“}”中的意外“}”如果...打印()... ...其他的print() [英] Error: unexpected '}' in "}" if...print()...else...print()
本文介绍了错误:“}”中的意外“}”如果...打印()... ...其他的print()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经答应了:如果关闭支架应该在以前不在上面。
I WAS GIVEN ANSWER: THE if's closing BRACKET should be BEFORE ELSE not ABOVE.
此错误已经在这里讨论过:
错误:意外'}'在" }" 和
https://stackoverflow.com/questions/15303559/error-意外 - 在
但他们没有帮助我。
This error had already been discussed here: Error: unexpected '}' in " }" and https://stackoverflow.com/questions/15303559/error-unexpected-in But they do not help me.
我运行代码:
i <- 21
if(i==22){
print(c("xxx"))
}
else{
print(c("yyy"))
}
并收到错误
else {
错误:else中意外的其他 < br>
打印(c(yyy))
[1]yyy
}
错误:}中意外'}'
我在Windows上使用Rstudio,相当新的R版本和Rstudio,但不知道在哪里检查
I use Rstudio on Windows, quite new R version and Rstudio, but not sure where to check it
推荐答案
如果 s括号
Put the else after if
s bracket
i <- 21
if(i==22){
print(c("xxx"))
}else{
print(c("yyy"))
}
##[1] "yyy"
这篇关于错误:“}”中的意外“}”如果...打印()... ...其他的print()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文