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.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to