[R] extract rows with unique values from data.frame

Nicolas Gutierrez nicolasg at uw.edu
Tue Mar 8 05:29:06 CET 2011


Dear Bill.. .great, thanks for your quick response.

Cheers

Nico


On 3/7/2011 8:16 PM, Bill.Venables at csiro.au wrote:
> i<- with(pop, cumsum(!duplicated(cbind(xloc, yloc))))
>>
>>  k<- 2  ## how many do you want?
>>
>>  no<- min(which(i == k))
>>  pop[1:no, ]



More information about the R-help mailing list