How to subset my data with eliminating repeated observations
问题 How can I erase repeated observations of IGM? I want to make following data as one IGM per one county. I tried data$GM[data$county] But it didn't work, because I need a row number inside [], not a county number. How can I match one GM per one county? To be clear, I want to make this data county cd110 repvote state GM gini 2 1001 102 1 Alabama 38.4 0.381 3 1001 102 1 Alabama 38.4 0.381 4 1003 101 0 Alabama 39.6 0.491 5 1003 101 0 Alabama 39.6 0.491 9 1003 101 0 Alabama 39.6 0.491 13 1003 101 1