Displaying 2 results from an estimated 2 matches for "schedule2".
Did you mean:
schedule
2010 Mar 18
2
Dataframe manipulation
...ime to create 24 hr time is as follows:
addTime2<-function(timeTxt,mins){
orig.date<-as.POSIXct(paste("2001-01-01",timeTxt))
new.Date<-orig.date+mins*60
new.Date<-strsplit(as.character(new.Date)," ")
new.Time<-(sapply(new.Date,"[",2))
return(new.Time)
}
SCHEDULE2$DEPART<-addTime2(SCHEDULE2$ARRIVE,SCHEDULE2$WAIT)
(code courtesy of Gustaf)
Thank you,
Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dataframe.pdf
Type: application/pdf
Size: 101190 bytes
Desc: Dataframe.pdf
URL: <https://stat.ethz.ch/pipermail/r-h...
2010 Mar 19
2
Dataframe calculations
...eate 'DEPART', which will then be combined with 'TRAVEL'
(minutes) to yield the 'ARRIVE' time of line 3, etc. This
series of calc's will start anew beginning at each unique 'MM'
by 'DD' grouping. Any advice would be greatly appreciated.
Thank you,
Mike
SCHEDULE2 <-
structure(list(MM = c("05", "05", "05", "05", "05", "05", "05",
"05", "05", "05", "05", "05", "05", "05", "05", "05", "05",...