How to remove rows in a dataframe considering there are duplicates in one column of dataframe

前端 未结 2 1462
庸人自扰
庸人自扰 2021-01-16 08:50

Hi dear I have a little problem with a dataframe that has duplicates in a column. I would like to remove the rows where a column presents duplicates. For example my datafram

2条回答
  •  没有蜡笔的小新
    2021-01-16 09:23

    Use the function duplicated.

    Something like:

    data.subset <- data[!duplicated(data$ID),]
    

    Duplicated returns a true/false vector. The second duplicated entry in the vector will always return TRUE.

提交回复
热议问题