gpt4 book ai didi

r - "Unexpected Special in %:%"%do% foreach,语法正确,foreach包已经加载

转载 作者:行者123 更新时间:2023-12-05 03:09:10 25 4
gpt4 key购买 nike

foreach(i = 1:nrow(teamAttributes))
%:% foreach(j = 1:nrow(allTeams))
%do% if (teamAttributes$team_api_id[i] == allTeams$home_team_api_id[j]) {
subjectTeamAttributes <- rbind(teamAttributes[i, ], subjectTeamAttributes)
}

##错误信息

Error: unexpected SPECIAL in "%:%"
Error: unexpected SPECIAL in "%do%"
subjectTeamAttributes <- rbind(teamAttributes[i, ], subjectTeamAttributes)
Error in `[.data.frame`(teamAttributes, i, ) : object 'i' not found

最佳答案

上面由 Dason 回答。格式是问题所在。将所有内容放在一条线上解决了这个问题。

关于r - "Unexpected Special in %:%"%do% foreach,语法正确,foreach包已经加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43618079/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com