Skip to content
Prev 96810 / 398500 Next

the first and last case

do.call(rbind,lapply(split(dat, dat$ind), function(x) x[c(1,nrow(x)),]))
-------------------------------------------------------------------
Jacques VESLOT

CNRS UMR 8090
I.B.L (2?me ?tage)
1 rue du Professeur Calmette
B.P. 245
59019 Lille Cedex

Tel : 33 (0)3.20.87.10.44
Fax : 33 (0)3.20.87.10.31

http://www-good.ibl.fr
-------------------------------------------------------------------


Mauricio Cardeal a ?crit :