[R] from list to dataframe

From: <sms13+_at_pitt.edu>
Date: Thu 19 May 2005 - 08:39:26 EST

I was wondering if someone can help me figure out the following: I have two patient datasets, ds1 and ds2. ds1 has fields "patid", "date", and "lab1". ds2 has "patid", "date", and "lab2". I want to find all the patids that have at least 2 dated records for each lab. I started by splitting each dataset by patid, to create ds1.list and ds2.list. Then I did some processing (with sapply) to each list to get the lengths of each patient list item. Then I kind of lost my way and things got messy as I tried to extract just the patids of those with lengths >= 2, convert them to dataframes (which I didn't have much success with), and then merge the two dataframes to get a vector of the desired patids. Any help would be much appreciated.


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 19 08:50:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:50 EST