Skip to content
Prev 371408 / 398513 Next

help matching rows of a data frame

This question likely has a 1 line answer, I'm just not seeing it.  (2, 3, or 10 lines is 
fine too.)

For a vector I can do group  <- match(x, unqiue(x)) to get a vector that labels each 
element of x.
What is an equivalent if x is a data frame?

The result does not have to be fast: the data set will have < 100 elements.  Since this is 
inside the survival package, and that package is on  the 'recommended' list, I can't 
depend on any package outside the recommended list.

Terry T.