s-news
[Top] [All Lists]

subsetting data frames

To: s-news <s-news@lists.biostat.wustl.edu>
Subject: subsetting data frames
From: Pedram Sendi <psendi@uhbs.ch>
Date: Tue, 20 May 2003 17:40:26 +0200
Encoding: 44 TEXT
Organization: IKE
Reply-to: "psendi@uhbs.ch" <psendi@uhbs.ch>
Dear S-Folks

Thanks to all those who replied to my last question. I have a question 
which must be easy to answer but I do not seem to find the solution. Assume 
I have a dataframe with multiple entries for the same patient (id), how do 
I create a subset of the dataframe that is based on the minimum of a given 
variable, e.g. I have

id      V1
1       0
1       2
1       3
1       8
2       3
2       2
2       1
2       5
3       2
3       1
3       0

and I would like to create subset

id      V1
1       0
2       1
3       0

Any help would be greatly appreciated.

Pedram

Pedram Sendi, MD, DSc
Institute for Clinical Epidemiology & Division of Infectious Diseases
Institut fur klinische Epidemiologie & Abteilung fur Infektiologie
Basel University Hospital
Kantonsspital Basel
Hebelstrasse 10, 3rd Floor
CH-4031 Basel
Switzerland
Phone: +41 61 265 31 02
Fax: +41 61 265 31 09
E-Mail: psendi@uhbs.ch




<Prev in Thread] Current Thread [Next in Thread>
  • subsetting data frames, Pedram Sendi <=