[R] Subtract Date Between columns

MSousa ricardosousa2000 at clix.pt
Thu Mar 15 11:21:57 CET 2012


Hello 

   I have this little dataset, my goal is create one column in the
data.frame with between the diference DataTime and Duration.
  I'm using the next code to make do this

TIME_STAMP   SESSIONTIME    Time                  TimeStart
1162343932 	8320	        2006-10-31 19:01:34       2006-10-31 16:42:54
1162343215    592		 2006-10-31 19:02:04       2006-10-31 18:52:12
1162341465    11875         2006-10-31 19:02:27       2006-10-31 15:44:32
1162339324    118           2006-10-31 19:03:01       2006-10-31 19:03:03
1162339381    2

Dataset$Time<-as.POSIXlt(TIME_STAMP, origin="1970-01-01",
tz="America/New_York")
temp1<-Dataset$Time-Dataset$SESSIONTIME
Dataset$TimeStart<-as.POSIXlt(temp1, origin="1970-01-01",
tz="America/New_York")


  I don't understand why changed the data in column TimeStar on 4 register

   Thanks

--
View this message in context: http://r.789695.n4.nabble.com/Subtract-Date-Between-columns-tp4474466p4474466.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list