text_combined: frank e harrell jr fharrellvanderbiltedu fast way using tapply may found section 438 httpbiostatmcvanderbiltedutwikipubmainrssintropdf frank daniel malter wrote problem recently used loop assume data frame called data units observation subject firstroundindexnull finalroundindexnull fori uniquesubject firstroundindeximinwhichsubjecti finalroundindeximaxwhichsubjecti firstroundindexfirstroundindexisnafirstroundindexf finalroundindexfinalroundindexisnafinalroundindexf gives row numbers first respectively last observation subject select data rows data according first finalrowindex eg datafirstrounddatafirstroundindex datafinalrounddatafinalroundindex cuncta stricte discussurus ursprüngliche nachricht von rhelpbouncesrprojectorg mailtorhelpbouncesrprojectorg im auftrag von luwis tapiwa diya gesendet thursday august 07 2008 622 rhelprprojectorg betreff r obtaining first last record subject alongitudinal study dear r users wondering anyone knows obtainsubset first andor last record subject longitudinal setup normally sas one uses firstvariable1 lastvariable1 question r way regards luwis diya phd student biostatistics biostatistical center school public health catholic university leuven uz st raphael kapucijnenvoer 35 b3000 leuven belgium cell 320497 22 94 83 phone32016 32 68 86 office phone32016 32 98 76 home fax 32016 33 70 15 email luwisdiyamedkuleuvenbe httpmedkuleuvenbebiostatstaffldhtm frank e harrell jr professor chair school medicine department biostatistics vanderbilt university ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code thu 07 aug 2008 093803 0500 r obtaining first last record subject alongitudinal study