Displaying 1 result from an estimated 1 matches for "thenightshifts".
2009 May 29
1
code optimization problem ... using or not using "which" function
...atasets in example code:
for( i in 1: nrow( new_trayloc) {
theshifts<-which(as.Date(capacity$shift_dt) == new_trayloc$admit_dt[i] &
as.character(capacity$unit)==as.character(new_trayloc$UNIT_1[i]) &
as.character(capacity$fac_id)==as.character(new_trayloc$ORIG_FAC_ID[i]))
thenightshifts<-which(as.Date(capacity$shift_dt) == new_trayloc$admit_dt[i]-1 &
as.character(capacity$unit)==as.character(new_trayloc$UNIT_1[i]) &
as.character(capacity$fac_id)==as.character(new_trayloc$ORIG_FAC_ID[i]))
..... obtain information by using theshifts and thenightshifts object...