Re: [R] duplicates including first occurrence

2019-01-28 Thread Bert Gunter
... Alternatively(but probably less efficient): ## the indexing logical vector with(mtcars, wt %in% wt[duplicated(wt)] ) cheers, Bert 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

Re: [R] duplicates including first occurrence

2019-01-28 Thread Rui Barradas
Hello, Simply OR (|) both conditions. mtcars[duplicated(mtcars$wt) | duplicated(mtcars$wt,fromLast=TRUE),] # mpg cyl disp hp drat wt qsec vs am gear carb #Hornet Sportabout 18.7 8 360.0 175 3.15 3.44 17.02 0 032 #Duster 36014.3 8 360.0 245 3.21 3.57 1

[R] duplicates including first occurrence

2019-01-28 Thread Knut Krueger via R-help
Ho to all i get the results mtcars[duplicated(mtcars$wt,fromLast=TRUE),] Hornet Sportabout 18.7 8 360.0 175 3.15 3.44 17.02 0 032 Duster 36014.3 8 360.0 245 3.21 3.57 15.84 0 034 Merc 280 19.2 6 167.6 123 3.92 3.44 18.30 1 044 mtcars[duplic