R How to compare Rows and Delete by Matching Strings -
match date points opponent points reb opponent reb dal vs den 8/16/2015 20 21 10 15 den vs dal 8/16/2015 21 20 15 10
i have dataframe sports data. however, have 2 rows every game due way data had collected. example 2 rows above same game, again data had collected twice each game in case: once dal
, 1 den
.
i'd find way delete duplicate games. figure 1 of conditions compare have game date. how else able tell r check delete duplicate rows? assume should able tell r to:
- check game date matches
- if game date match , if "teams" match delete duplicate. (can done though strings not exact match, i.e. since
den vs dal
,dal vs den
not matching string?) - move on next row , repeat until end of spreadsheet.
- r not need check more 50 rows down before moving on next row.
- is there function test matching individual words? example not want have tell r: "if cell contains
den
... or "if cell containsdal
involve many teams. r needs able check cells value in , find out if same value can found string in later rows.
please help.