1

Suppose I got a data table with multiple columns. I want to update this data table in such a way that only unique observations by a pre specified column appear. For example,

data.table(c(1,2,2,3,4),c(2,3,5,4,3))

should be transformed to

data.table(c(1,2,3,4),c(2,3,4,3))

Here the pre-specified column is the first one I tried to use unique() function, but it returns vector with unique values and does nothing with the data table itself

zx8754
  • 52,746
  • 12
  • 114
  • 209
John P.
  • 139
  • 5

0 Answers0