Skip to content
Prev 381650 / 398502 Next

how to find number of unique rows for combination of r columns

Correction:
df <- data.frame(a = 1:3, b = letters[c(1,1,2)], d = LETTERS[c(1,1,2)])
df[!duplicated(df[,2:3]), ]  ## Note the ! sign

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Fri, Nov 8, 2019 at 7:59 AM Bert Gunter <bgunter.4567 at gmail.com> wrote: