Displaying 1 result from an estimated 1 matches for "unit_1".
Did you mean:
unit1
2009 May 29
1
code optimization problem ... using or not using "which" function
...my first initial idea (which I know is bad) goes like this:
## capacity and new_trayloc are datasets 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.char...