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 Messages
Error: unexpected SPECIAL in "%:%"
Error: unexpected SPECIAL in "%do%"
subjectTeamAttributes <- rbind(teamAttributes[i, ], subjectTeamAttributes)
Error in `[.data.frame`(teamAttributes, i, ) : object 'i' not found
All pipes should be at the end of the previous line and not at the start of the second line. Please insert %do% at the end of lines 1 and 2
Answered by Dason above. THe format was the issue. Putting it all on one line solved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With