R get rid of rows with duplicate attribute
Posted
by CatholicEvangelist
on Stack Overflow
See other posts from Stack Overflow
or by CatholicEvangelist
Published on 2010-05-03T16:05:57Z
Indexed on
2010/05/03
16:08 UTC
Read the original article
Hit count: 222
hi there
I have a big dataframe with columns such as:
ID, time, OS, IP
Each row of that dataframe corresponds to one entry. Within that dataframe for some IDs serveral entries (rows) exist.
I would like to get rid of those multiple rows (obviously the other attributes will differ for the same ID). Or put different: I only want one single entry (row) for each ID.
Could anyone be so kind and help me out on this one?
When I use unique, on the ID column, I only recieve the levels (or each unique ID), but I want to keep the other attributes as well...
I have tried to use apply(x,2,unique(data$ID)), but this does not work either...
Any help is highly appreciated!
© Stack Overflow or respective owner