Displaying 1 result from an estimated 1 matches for "theshifts".
2009 May 29
1
code optimization problem ... using or not using "which" function
...of interest (
facility, unit, date) which I want to match up, and from this extract
information from one dataset and store it in the other.
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$admi...