意想不到的'),我想不通
我收到以下错误。我不知道缺少什么,因为我似乎所有的括号都匹配了。
错误:意外的“)”位于: “{ if (grepl(propertiesData[x,'city'],population[z,'NAME'],ignore.case=TRUE) & (propertiesData[x,'stateLong']==population[z,'STATENAME')"
这是循环的代码:
for (z in c(1:nrow(population)))
{
if (grepl(propertiesData[x,'city'],population[z,'NAME'],ignore.case=TRUE) & (propertiesData[x,'stateLong']==population[z,'STATENAME'))
{
propertiesData[x,'population']=population[z,'POP_2009']
break
}
}
I am getting the following error. I can not figure out what is missing, as I seem to have all my brackets matched up.
Error: unexpected ')' in:
"{
if (grepl(propertiesData[x,'city'],population[z,'NAME'],ignore.case=TRUE) & (propertiesData[x,'stateLong']==population[z,'STATENAME')"
Here is the code of the loop:
for (z in c(1:nrow(population)))
{
if (grepl(propertiesData[x,'city'],population[z,'NAME'],ignore.case=TRUE) & (propertiesData[x,'stateLong']==population[z,'STATENAME'))
{
propertiesData[x,'population']=population[z,'POP_2009']
break
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看来您忘记了右括号。添加它,看看会发生什么:
Seems like you forgot the closing bracket. Add it in and see what happens:
您在行尾缺少一个
]
。...==人口[z,'STATENAME'] ))
You're missing one
]
at the end of line....==population[z,'STATENAME'] ))
您在末尾缺少“]”:(propertiesData[x,'stateLong']==population[z,'STATENAME']))
You are missing "]" at the end : (propertiesData[x,'stateLong']==population[z,'STATENAME']))