0

I have uploaded a csv file to r with mostly binary data. What I want to do is manipulate data in column 'b' based on the the corresponding entry in column 'a.'

For example, I would love to loop through my entire dataset and for every row with an entry of '1' in column 2, check to see the entry in column 3 in the same row. Then, find out how many of these successful queries exist.

Similarly, I have several columns of large integers and would love to confirm one of the other binary columns by checking if one of the large numbers is greater than the other. For example, column '3' is the binary result of "Home team wins?" I then have the score of the game in Column "Home team score" and "Away team score." I would really love to create a loop that would see if the entry in 'home team wins' is confirmed by the entry in 'home team score' > 'away team score.'

Thank you

4

1 に答える 1