This is follow up to a previous question.
The dataset looks like the following:
dat <- read.table(header=TRUE, text="
ID Veh oct nov dec jan feb
1120 1 7 47 152 259 140
2000 1 5 88 236 251 145
2000 2 14 72 263 331 147
1133 1 6 71 207 290 242
2000 3 7 47 152 259 140
2002 1 5 88 236 251 145
2006 1 14 72 263 331 147
2002 2 6 71 207 290 242
")
dat
ID Veh oct nov dec jan feb
1 1120 1 7 47 152 259 140
2 2000 1 5 88 236 251 145
3 2000 2 14 72 263 331 147
4 1133 1 6 71 207 290 242
5 2000 3 7 47 152 259 140
6 2002 1 5 88 236 251 145
7 2006 1 14 72 263 331 147
8 2002 2 6 71 207 290 242
I like to keep only non-duplicate rows based on first column values. The output will be like this:
ID Veh oct nov dec jan feb
1 1120 1 7 47 152 259 140
2 1133 1 6 71 207 290 242
3 2006 1 14 72 263 331 147
A possible solution is here. But that question doesn't have reproducible example.