try this:
> x <- read.table(text = "id wtdt wt lastpk
+
+ 64050256 2010-09-18 275 2010-09-16
+
+ 64050256 2010-09-19 277 2010-09-18
+
+ 64050256 2010-09-20 272 2010-09-18
+
+ 64050256 2010-09-21 277 2010-09-18", as.is = TRUE, header = TRUE)
>
> first
?tapply
?with is also useful here
as in (untested)
with(yourdataframe, tapply(lastpk, id, unique))
-- Bert
On Wed, May 2, 2012 at 7:58 AM, Ayyappa Chaturvedula
wrote:
> Dear Group,
>
> I am working with a large dataset where I need to select for each unique id
> the the unique lastpk row. Her
2 matches
Mail list logo