Skip to content
Prev 206590 / 398506 Next

Comparing dates in dataframes

My guess (since we still have no data on which to test these ideas)   
is that you need either to merge() or to use a matrix created from the  
dates and qtr-hours entries in "gw", since matching on dates and hours  
separately will not uniquely classify the good qtr-hours within their  
proper corresponding dates. You want a structure (or a matching  
process) that takes:
	hqhr1	qhr2	qhr3	qhr4 .......
date1	good	bad	good	bad
date2	bad	good	good	good
date3	bad	bad	bad	good
.
.
.
and lets you use the values in "arr" to get values in "gw". Notice  
that the notion of arr$Date %in% gw$date & arr$qtrhr %in% gw$qtrhr  
simply will not accomplish anything correct/

Merging by multiple criteria (with the merge function) would do that  
or you could construct a matrix whose entries were the categories  
good /bad. The table function could create the matrix for the purpose  
of using an indexed solution if you are dead-set against the merge  
concept.
On Jan 17, 2010, at 4:47 PM, James Rome wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT