[R] Dataframe calculations
Hosack, Michael
mhosack at state.pa.us
Fri Mar 19 17:30:13 CET 2010
Erich,
Thank you so much for the effort you put into writing this code.
I ran it and then assigned the two variables you created to the
'ARRIVE' and 'DEPART' variables of my dataframe as you directed and
the resultant calculations were incorrect. I am not sure why it did
not work, I do not yet grasp the coding, I am still a novice.
Perhaps you or someone else could rerun your code on my original
dataframe and see why it did not yield the correct results.
Thank you,
Mike
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Erich Neuwirth
Sent: Friday, March 19, 2010 11:38 AM
To: r-help at r-project.org
Subject: Re: [R] Dataframe calculations
with the following code
newvars()$ARRIVALS and newvars()$DEPARTURES
will give you the new variables you need.
-=-=-=
addDelays <- function(arriveTime,waitVec,travelVec){
start<-as.POSIXct(arriveTime,format="%H:%M:%S")
delays<-as.vector(t(cbind(waitVec,travelVec)))
newtimes<-format(start+cumsum(delays)*60,format="%H:%M:%S")
list(departs=c(arriveTime,(odds(newtimes))[-1]),
arrives=evens(newtimes))
}
odds <- function(inVec){
indvec<-0:(floor((length(inVec)-1)/2))
inVec[2*indvec+1]
}
evens <- function(inVec){
odds(inVec[-1])
}
newvars <- function(){
DATE<-with(SCHEDULE2,paste(YEAR,MM,DD,sep=""))
starts<-as.list(with(SCHEDULE2,tapply(ARRIVE,DATE,function(x)x[1])))
waits<-with(SCHEDULE2,tapply(WAIT,DATE,function(x)x))
travels<-with(SCHEDULE2,tapply(TRAVEL,DATE,function(x)x))
list(DEPARTURES=
as.vector(mapply(function(...)addDelays(...)$departs,starts,waits,travels)),
ARRIVALS=
as.vector(mapply(function(...)addDelays(...)$arrives,starts,waits,travels)))
}
SCHEDULE2 <-
structure(list(MM = c("05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "05", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "06", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10"), DD = c("02", "02", "02", "02", "03", "03", "03", "03", "06", "06", "06", "06", "09", "09", "09", "09", "10", "10", "10", "10", "14", "14", "14", "14", "16", "16", "16", "16", "17", "17", "17", "17", "19", "19", "19", "19", "22", "22", "22", "22", "24", "24", "24", "24", "27", "27", "27", "27", "29", "29", "29", "29", "31", "31", "31", "31", "04", "04", "04", "04", "06", "06", "06", "06", "07", "07", "07", "07", "10", "10", "10", "10", "12", "12", "12", "12", "16", "16", "16", "16", "17", "17", "17", "17", "19", "19", "19", "19", "22", "22", "22", "22", "23", "23", "23", "23", "27", "27", "27", "27", "28", "28", "28", "28", "29", "29", "29", "29", "03", "03", "03", "03", "05", "05", "05", "05", "09", "09", "09", "09", "10", "10", "10", "10", "13", "13", "13", "13", "14", "14", "14", "14", "18", "18", "18", "18", "22", "22", "22", "22", "23", "23", "23", "23", "24", "24", "24", "24", "27", "27", "27", "27", "28", "28", "28", "28", "01", "01", "01", "01", "04", "04", "04", "04", "06", "06", "06", "06", "07", "07", "07", "07", "12", "12", "12", "12", "13", "13", "13", "13", "14", "14", "14", "14", "16", "16", "16", "16", "19", "19", "19", "19", "21", "21", "21", "21", "23", "23", "23", "23", "24", "24", "24", "24", "28", "28", "28", "28", "31", "31", "31", "31", "02", "02", "02", "02", "04", "04", "04", "04", "08", "08", "08", "08", "09", "09", "09", "09", "11", "11", "11", "11", "14", "14", "14", "14", "16", "16", "16", "16", "19", "19", "19", "19", "20", "20", "20", "20", "21", "21", "21", "21", "26", "26", "26", "26", "27", "27", "27", "27", "29", "29", "29", "29", "03", "03", "03", "03", "05", "05", "05", "05", "08", "08", "08", "08", "10", "10", "10", "10", "14", "14", "14", "14", "15", "15", "15", "15", "16", "16", "16", "16", "20", "20", "20", "20", "21", "21", "21", "21", "24", "24", "24", "24", "26", "26", "26", "26", "29", "29", "29", "29", "30", "30", "30", "30"
), YEAR = c("2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010", "2010"), DOW = c("SUN", "SUN", "SUN", "SUN", "MON", "MON", "MON", "MON", "THR", "THR", "THR", "THR", "SUN", "SUN", "SUN", "SUN", "MON", "MON", "MON", "MON", "FRI", "FRI", "FRI", "FRI", "SUN", "SUN", "SUN", "SUN", "MON", "MON", "MON", "MON", "WED", "WED", "WED", "WED", "SAT", "SAT", "SAT", "SAT", "MON", "MON", "MON", "MON", "THR", "THR", "THR", "THR", "SAT", "SAT", "SAT", "SAT", "MON", "MON", "MON", "MON", "FRI", "FRI", "FRI", "FRI", "SUN", "SUN", "SUN", "SUN", "MON", "MON", "MON", "MON", "THR", "THR", "THR", "THR", "SAT", "SAT", "SAT", "SAT", "WED", "WED", "WED", "WED", "THR", "THR", "THR", "THR", "SAT", "SAT", "SAT", "SAT", "TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "SUN", "SUN", "SUN", "SUN", "MON", "MON", "MON", "MON", "TUE", "TUE", "TUE", "TUE", "SAT", "SAT", "SAT", "SAT", "MON", "MON", "MON", "MON", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "SUN", "SUN", "SUN", "SUN", "THR", "THR", "THR", "THR", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "TUE", "TUE", "TUE", "TUE", "WED", "WED", "WED", "WED", "SUN", "SUN", "SUN", "SUN", "WED", "WED", "WED", "WED", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "THR", "THR", "THR", "THR", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "MON", "MON", "MON", "MON", "THR", "THR", "THR", "THR", "SAT", "SAT", "SAT", "SAT", "MON", "MON", "MON", "MON", "TUE", "TUE", "TUE", "TUE", "SAT", "SAT", "SAT", "SAT", "TUE", "TUE", "TUE", "TUE", "THR", "THR", "THR", "THR", "SAT", "SAT", "SAT", "SAT", "WED", "WED", "WED", "WED", "THR", "THR", "THR", "THR", "SAT", "SAT", "SAT", "SAT", "TUE", "TUE", "TUE", "TUE", "THR", "THR", "THR", "THR", "SUN", "SUN", "SUN", "SUN", "MON", "MON", "MON", "MON", "TUE", "TUE", "TUE", "TUE", "SUN", "SUN", "SUN", "SUN", "MON", "MON", "MON", "MON", "WED", "WED", "WED", "WED", "SUN", "SUN", "SUN", "SUN", "TUE", "TUE", "TUE", "TUE", "FRI", "FRI", "FRI", "FRI", "SUN", "SUN", "SUN", "SUN", "THR", "THR", "THR", "THR", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT", "WED", "WED", "WED", "WED", "THR", "THR", "THR", "THR", "SUN", "SUN", "SUN", "SUN", "TUE", "TUE", "TUE", "TUE", "FRI", "FRI", "FRI", "FRI", "SAT", "SAT", "SAT", "SAT"), DTYPE = c(2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L), WEEK = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27 ), TOD = c(2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L),
SITE1 = c(101, 102, 103, 104, 103, 104, 101, 102, 101, 102,
103, 104, 101, 102, 103, 104, 103, 104, 101, 102, 103, 104,
101, 102, 102, 103, 104, 101, 101, 102, 103, 104, 102, 103,
104, 101, 103, 104, 101, 102, 103, 104, 101, 102, 103, 104,
101, 102, 104, 101, 102, 103, 102, 103, 104, 101, 104, 101,
102, 103, 101, 102, 103, 104, 104, 101, 102, 103, 103, 104,
101, 102, 103, 104, 101, 102, 102, 103, 104, 101, 101, 102,
103, 104, 102, 103, 104, 101, 103, 104, 101, 102, 101, 102,
103, 104, 103, 104, 101, 102, 103, 104, 101, 102, 104, 101,
102, 103, 103, 104, 101, 102, 101, 102, 103, 104, 101, 102,
103, 104, 103, 104, 101, 102, 102, 103, 104, 101, 103, 104,
101, 102, 104, 101, 102, 103, 103, 104, 101, 102, 101, 102,
103, 104, 103, 104, 101, 102, 103, 104, 101, 102, 103, 104,
101, 102, 101, 102, 103, 104, 104, 101, 102, 103, 101, 102,
103, 104, 104, 101, 102, 103, 103, 104, 101, 102, 102, 103,
104, 101, 103, 104, 101, 102, 102, 103, 104, 101, 102, 103,
104, 101, 104, 101, 102, 103, 101, 102, 103, 104, 103, 104,
101, 102, 103, 104, 101, 102, 102, 103, 104, 101, 101, 102,
103, 104, 104, 101, 102, 103, 104, 101, 102, 103, 101, 102,
103, 104, 104, 101, 102, 103, 103, 104, 101, 102, 102, 103,
104, 101, 102, 103, 104, 101, 103, 104, 101, 102, 104, 101,
102, 103, 101, 102, 103, 104, 103, 104, 101, 102, 104, 101,
102, 103, 103, 104, 101, 102, 101, 102, 103, 104, 104, 101,
102, 103, 103, 104, 101, 102, 103, 104, 101, 102, 101, 102,
103, 104, 102, 103, 104, 101, 103, 104, 101, 102, 104, 101,
102, 103, 103, 104, 101, 102, 101, 102, 103, 104, 104, 101,
102, 103, 103, 104, 101, 102), ARRIVE = c("14:30:00", "0",
"0", "0", "07:00:00", "0", "0", "0", "07:00:00", "0", "0",
"0", "14:30:00", "0", "0", "0", "07:00:00", "0", "0", "0",
"07:00:00", "0", "0", "0", "07:00:00", "0", "0", "0", "07:00:00",
"0", "0", "0", "14:30:00", "0", "0", "0", "07:00:00", "0",
"0", "0", "14:30:00", "0", "0", "0", "07:00:00", "0", "0",
"0", "07:00:00", "0", "0", "0", "07:00:00", "0", "0", "0",
"14:30:00", "0", "0", "0", "07:00:00", "0", "0", "0", "14:30:00",
"0", "0", "0", "07:00:00", "0", "0", "0", "07:00:00", "0",
"0", "0", "14:30:00", "0", "0", "0", "07:00:00", "0", "0",
"0", "07:00:00", "0", "0", "0", "14:30:00", "0", "0", "0",
"07:00:00", "0", "0", "0", "07:00:00", "0", "0", "0", "07:00:00",
"0", "0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0",
"0", "0", "14:30:00", "0", "0", "0", "07:00:00", "0", "0",
"0", "07:00:00", "0", "0", "0", "14:30:00", "0", "0", "0",
"14:30:00", "0", "0", "0", "07:00:00", "0", "0", "0", "07:00:00",
"0", "0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0",
"0", "0", "07:00:00", "0", "0", "0", "07:00:00", "0", "0",
"0", "14:30:00", "0", "0", "0", "07:00:00", "0", "0", "0",
"14:30:00", "0", "0", "0", "14:30:00", "0", "0", "0", "07:00:00",
"0", "0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0",
"0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0", "0",
"0", "14:30:00", "0", "0", "0", "07:00:00", "0", "0", "0",
"07:00:00", "0", "0", "0", "07:00:00", "0", "0", "0", "14:30:00",
"0", "0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0",
"0", "0", "07:00:00", "0", "0", "0", "07:00:00", "0", "0",
"0", "14:30:00", "0", "0", "0", "14:30:00", "0", "0", "0",
"14:30:00", "0", "0", "0", "14:30:00", "0", "0", "0", "14:30:00",
"0", "0", "0", "07:00:00", "0", "0", "0", "07:00:00", "0",
"0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0", "0",
"0", "14:30:00", "0", "0", "0", "14:30:00", "0", "0", "0",
"14:30:00", "0", "0", "0", "07:00:00", "0", "0", "0", "07:00:00",
"0", "0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0",
"0", "0", "07:00:00", "0", "0", "0", "14:30:00", "0", "0",
"0", "07:00:00", "0", "0", "0", "14:30:00", "0", "0", "0",
"07:00:00", "0", "0", "0", "14:30:00", "0", "0", "0"), WAIT = c(100,
60, 60, 100, 60, 100, 100, 60, 100, 60, 60, 100, 100, 60,
60, 100, 60, 100, 100, 60, 60, 100, 100, 60, 60, 60, 100,
100, 100, 60, 60, 100, 60, 60, 100, 100, 60, 100, 100, 60,
60, 100, 100, 60, 60, 100, 100, 60, 100, 100, 60, 60, 60,
60, 100, 100, 100, 100, 60, 60, 100, 60, 60, 100, 100, 100,
60, 60, 60, 100, 100, 60, 60, 100, 100, 60, 60, 60, 100,
100, 100, 60, 60, 100, 60, 60, 100, 100, 60, 100, 100, 60,
100, 60, 60, 100, 60, 100, 100, 60, 60, 100, 100, 60, 100,
100, 60, 60, 60, 100, 100, 60, 100, 60, 60, 100, 100, 60,
60, 100, 60, 100, 100, 60, 60, 60, 100, 100, 60, 100, 100,
60, 100, 100, 60, 60, 60, 100, 100, 60, 100, 60, 60, 100,
60, 100, 100, 60, 60, 100, 100, 60, 60, 100, 100, 60, 100,
60, 60, 100, 100, 100, 60, 60, 100, 60, 60, 100, 100, 100,
60, 60, 60, 100, 100, 60, 60, 60, 100, 100, 60, 100, 100,
60, 60, 60, 100, 100, 60, 60, 100, 100, 100, 100, 60, 60,
100, 60, 60, 100, 60, 100, 100, 60, 60, 100, 100, 60, 60,
60, 100, 100, 100, 60, 60, 100, 100, 100, 60, 60, 100, 100,
60, 60, 100, 60, 60, 100, 100, 100, 60, 60, 60, 100, 100,
60, 60, 60, 100, 100, 60, 60, 100, 100, 60, 100, 100, 60,
100, 100, 60, 60, 100, 60, 60, 100, 60, 100, 100, 60, 100,
100, 60, 60, 60, 100, 100, 60, 100, 60, 60, 100, 100, 100,
60, 60, 60, 100, 100, 60, 60, 100, 100, 60, 100, 60, 60,
100, 60, 60, 100, 100, 60, 100, 100, 60, 100, 100, 60, 60,
60, 100, 100, 60, 100, 60, 60, 100, 100, 100, 60, 60, 60,
100, 100, 60), DEPART = c("16:10:00", "0", "0", "0", "08:00:00",
"0", "0", "0", "08:40:00", "0", "0", "0", "16:10:00", "0",
"0", "0", "08:00:00", "0", "0", "0", "08:00:00", "0", "0",
"0", "08:00:00", "0", "0", "0", "08:40:00", "0", "0", "0",
"15:30:00", "0", "0", "0", "08:00:00", "0", "0", "0", "15:30:00",
"0", "0", "0", "08:00:00", "0", "0", "0", "08:40:00", "0",
"0", "0", "08:00:00", "0", "0", "0", "16:10:00", "0", "0",
"0", "08:40:00", "0", "0", "0", "16:10:00", "0", "0", "0",
"08:00:00", "0", "0", "0", "08:00:00", "0", "0", "0", "15:30:00",
"0", "0", "0", "08:40:00", "0", "0", "0", "08:00:00", "0",
"0", "0", "15:30:00", "0", "0", "0", "08:40:00", "0", "0",
"0", "08:00:00", "0", "0", "0", "08:00:00", "0", "0", "0",
"08:40:00", "0", "0", "0", "15:30:00", "0", "0", "0", "16:10:00",
"0", "0", "0", "08:40:00", "0", "0", "0", "08:00:00", "0",
"0", "0", "15:30:00", "0", "0", "0", "15:30:00", "0", "0",
"0", "08:40:00", "0", "0", "0", "08:00:00", "0", "0", "0",
"08:40:00", "0", "0", "0", "15:30:00", "0", "0", "0", "08:00:00",
"0", "0", "0", "08:00:00", "0", "0", "0", "16:10:00", "0",
"0", "0", "08:40:00", "0", "0", "0", "16:10:00", "0", "0",
"0", "16:10:00", "0", "0", "0", "08:00:00", "0", "0", "0",
"08:00:00", "0", "0", "0", "15:30:00", "0", "0", "0", "08:00:00",
"0", "0", "0", "15:30:00", "0", "0", "0", "16:10:00", "0",
"0", "0", "08:40:00", "0", "0", "0", "08:00:00", "0", "0",
"0", "08:00:00", "0", "0", "0", "15:30:00", "0", "0", "0",
"08:40:00", "0", "0", "0", "16:10:00", "0", "0", "0", "08:40:00",
"0", "0", "0", "08:40:00", "0", "0", "0", "16:10:00", "0",
"0", "0", "15:30:00", "0", "0", "0", "15:30:00", "0", "0",
"0", "15:30:00", "0", "0", "0", "15:30:00", "0", "0", "0",
"08:40:00", "0", "0", "0", "08:40:00", "0", "0", "0", "08:00:00",
"0", "0", "0", "16:10:00", "0", "0", "0", "15:30:00", "0",
"0", "0", "16:10:00", "0", "0", "0", "16:10:00", "0", "0",
"0", "08:00:00", "0", "0", "0", "08:00:00", "0", "0", "0",
"08:40:00", "0", "0", "0", "15:30:00", "0", "0", "0", "08:00:00",
"0", "0", "0", "16:10:00", "0", "0", "0", "08:00:00", "0",
"0", "0", "16:10:00", "0", "0", "0", "08:40:00", "0", "0",
"0", "15:30:00", "0", "0", "0"), TRAVEL = c(30, 10, 35, 50,
35, 50, 30, 10, 30, 10, 35, 50, 30, 10, 35, 50, 35, 50, 30,
10, 35, 50, 30, 10, 10, 35, 50, 30, 30, 10, 35, 50, 10, 35,
50, 30, 35, 50, 30, 10, 35, 50, 30, 10, 35, 50, 30, 10, 50,
30, 10, 35, 10, 35, 50, 30, 50, 30, 10, 35, 30, 10, 35, 50,
50, 30, 10, 35, 35, 50, 30, 10, 35, 50, 30, 10, 10, 35, 50,
30, 30, 10, 35, 50, 10, 35, 50, 30, 35, 50, 30, 10, 30, 10,
35, 50, 35, 50, 30, 10, 35, 50, 30, 10, 50, 30, 10, 35, 35,
50, 30, 10, 30, 10, 35, 50, 30, 10, 35, 50, 35, 50, 30, 10,
10, 35, 50, 30, 35, 50, 30, 10, 50, 30, 10, 35, 35, 50, 30,
10, 30, 10, 35, 50, 35, 50, 30, 10, 35, 50, 30, 10, 35, 50,
30, 10, 30, 10, 35, 50, 50, 30, 10, 35, 30, 10, 35, 50, 50,
30, 10, 35, 35, 50, 30, 10, 10, 35, 50, 30, 35, 50, 30, 10,
10, 35, 50, 30, 10, 35, 50, 30, 50, 30, 10, 35, 30, 10, 35,
50, 35, 50, 30, 10, 35, 50, 30, 10, 10, 35, 50, 30, 30, 10,
35, 50, 50, 30, 10, 35, 50, 30, 10, 35, 30, 10, 35, 50, 50,
30, 10, 35, 35, 50, 30, 10, 10, 35, 50, 30, 10, 35, 50, 30,
35, 50, 30, 10, 50, 30, 10, 35, 30, 10, 35, 50, 35, 50, 30,
10, 50, 30, 10, 35, 35, 50, 30, 10, 30, 10, 35, 50, 50, 30,
10, 35, 35, 50, 30, 10, 35, 50, 30, 10, 30, 10, 35, 50, 10,
35, 50, 30, 35, 50, 30, 10, 50, 30, 10, 35, 35, 50, 30, 10,
30, 10, 35, 50, 50, 30, 10, 35, 35, 50, 30, 10)), .Names = c("MM", "DD", "YEAR", "DOW", "DTYPE", "WEEK", "TOD", "SITE1", "ARRIVE", "WAIT", "DEPART", "TRAVEL"), row.names = c("53", "531", "532", "533", "2", "210", "212", "214", "1", "110", "112", "114", "54", "541", "542", "543", "3", "310", "312", "314", "4", "410", "412", "414", "55", "551", "552", "553", "5", "510", "512", "514", "6", "610", "612", "614", "56", "561", "562", "563", "7", "710", "712", "714", "8", "81", "82", "83", "57", "571", "572", "573", "9", "91", "92", "93", "10", "101", "102", "103", "58", "581", "582", "583", "12", "121", "122", "123", "11", "111", "113", "115", "59", "591", "592", "593", "14", "141", "142", "143", "13", "131", "132", "133", "60", "601", "602", "603", "16", "161", "162", "163", "15", "151", "152", "153", "61", "611", "613", "615", "18", "181", "182", "183", "17", "171", "172", "173", "62", "621", "622", "623", "19", "191", "192", "193", "20", "201", "202", "203", "63", "631", "632", "633", "22", "221", "222", "223", "21", "211", "213", "215", "64", "641", "642", "643", "24", "241", "242", "243", "23", "231", "232", "233", "65", "651", "652", "653", "26", "261", "262", "263", "25", "251", "252", "253", "66", "661", "662", "663", "28", "281", "282", "283", "27", "271", "272", "273", "67", "671", "672", "673", "30", "301", "302", "303", "29", "291", "292", "293", "68", "681", "682", "683", "32", "321", "322", "323", "31", "311", "313", "315", "69", "691", "692", "693", "33", "331", "332", "333", "34", "341", "342", "343", "70", "701", "702", "703", "35", "351", "352", "353", "36", "361", "362", "363", "71", "711", "713", "715", "38", "381", "382", "383", "37", "371", "372", "373", "72", "721", "722", "723", "40", "401", "402", "403", "39", "391", "392", "393", "73", "731", "732", "733", "42", "421", "422", "423", "41", "411", "413", "415", "74", "741", "742", "743", "43", "431", "432", "433", "44", "441", "442", "443", "75", "751", "752", "753", "45", "451", "452", "453", "46", "461", "462", "463", "76", "761", "762", "763", "48", "481", "482", "483", "47", "471", "472", "473", "77", "771", "772", "773", "49", "491", "492", "493", "50", "501", "502", "503", "78", "781", "782", "783", "52", "521", "522", "523", "51", "511", "513", "515", "79", "791", "792", "793"), class = "data.frame")
--
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-39464 Fax: +43-1-4277-39459
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list