Re: [R] Time difference between two dates/timing

2012-06-14 Thread arun
ences in mins [1] 10 10 attr(,"tzone") [1] "" A.K. - Original Message - From: Rantony To: r-help@r-project.org Cc: Sent: Thursday, June 14, 2012 6:08 AM Subject: [R] Time difference between two dates/timing Hi, Here, i have a matrix like this MyMatrix <- *D

Re: [R] Time difference between two dates/timing

2012-06-14 Thread John Kane
"%d/%m/%Y %H:%M")) diff(dtime[,1]) John Kane Kingston ON Canada > -Original Message- > From: antony.akk...@ge.com > Sent: Thu, 14 Jun 2012 03:08:25 -0700 (PDT) > To: r-help@r-project.org > Subject: [R] Time difference between two dates/timing > > Hi, >

Re: [R] Time difference between two dates/timing

2012-06-14 Thread R. Michael Weylandt
You have been asked before (by me!) to give reproducible examples using dput()... You might need the diff() function. Michael On Thu, Jun 14, 2012 at 5:08 AM, Rantony wrote: > Hi, > > > Here, i have a matrix like this > > MyMatrix <- > > *DATETIME        HEADER1            HEADER2* > 1/1/2010 0

[R] Time difference between two dates/timing

2012-06-14 Thread Rantony
Hi, Here, i have a matrix like this MyMatrix <- *DATETIMEHEADER1HEADER2* 1/1/2010 0:10 197.1947 100.0859 1/1/2010 0:20 203.8811 100.1013 1/1/2010 0:30 206.564 100.0433 1/1/2010 0:40 207.9563

Re: [R] time difference

2010-04-22 Thread Carol Gao
thank you! this really helps! On Thu, Apr 22, 2010 at 7:00 PM, jim holtman wrote: > ?strptime > > Read the documentation and you will find reference to "%OSn" > > > x <- strptime('13:45:34.123', format="%H:%M:%OS") > > x > [1] "2010-04-22 13:45:34" > > format(x, format="%H:%M:%OS3") > [1] "13:45

Re: [R] time difference

2010-04-22 Thread Stefan
Carol Gao gmail.com> writes: > > Hi, > > Does anyone know how to take a time difference when the format of the time > is as 13:22:23.586? I am trying to take the difference of time between stock > transactions and need to keep the three decimal places for seconds. I have > tried *diff(strptime(

Re: [R] time difference

2010-04-22 Thread jim holtman
?strptime Read the documentation and you will find reference to "%OSn" > x <- strptime('13:45:34.123', format="%H:%M:%OS") > x [1] "2010-04-22 13:45:34" > format(x, format="%H:%M:%OS3") [1] "13:45:34.123" > On Thu, Apr 22, 2010 at 2:58 AM, Carol Gao wrote: > Hi, > > Does anyone know how to ta

[R] time difference

2010-04-21 Thread Carol Gao
Hi, Does anyone know how to take a time difference when the format of the time is as 13:22:23.586? I am trying to take the difference of time between stock transactions and need to keep the three decimal places for seconds. I have tried *diff(strptime(x, "%H:%M:%S.000))*, but apperantly that doesn

Re: [R] time difference

2009-07-22 Thread Dirk Eddelbuettel
On 22 July 2009 at 09:44, Erin Hodgess wrote: | I am looking at the ctime attribute of two different files. It | contains the year, month, day, time of creation and time zone. [ Well only if you convert it to POSIXlt... ] | Is there a way to determine the difference between the ctimes of two |

Re: [R] time difference

2009-07-22 Thread Gabor Grothendieck
Try this: > file.info("abc.R")$ctime - file.info("aa.R")$ctime Time difference of 228.9912 days On Wed, Jul 22, 2009 at 10:44 AM, Erin Hodgess wrote: > Dear R People: > > I am looking at the ctime attribute of two different files.  It > contains the year, month, day, time of creation and time zo

Re: [R] time difference

2009-07-22 Thread David Huffer
On Wednesday, July 22, 2009 10:44 AM, Erin Hodgess wrote: > ...I am looking at the ctime attribute of > two different files. It contains the year, > month, day, time of creation and time zone. > Is there a way to determine the difference > between the ctimes of two files, please... a

[R] time difference

2009-07-22 Thread Erin Hodgess
Dear R People: I am looking at the ctime attribute of two different files. It contains the year, month, day, time of creation and time zone. Is there a way to determine the difference between the ctimes of two files, please? I looked in the chron package and nothing seemed to work. Thanks in a

Re: [R] time difference (from date function)

2009-03-18 Thread jim holtman
If what you have is a character string, then convert it to POSIXlt and use difftime: > x1 [1] "Wed Mar 18 12:18:11 2009" > x2 [1] "Wed Mar 18 12:18:18 2009" > x1.c <- strptime(x1, "%a %b %d %H:%M:%S %Y") > x2.c <- strptime(x2, "%a %b %d %H:%M:%S %Y") > difftime(x2.c, x1.c, units='secs') Time diffe

[R] time difference (from date function)

2009-03-18 Thread milton ruser
Dear all, I have two variables which contents are date() function answers, like: d1<-date() d2<-date() Now I need to compute the difference between d2 and d1 (in minutes). Any help are welcome. Best wishes miltinho brazil [[alternative HTML version deleted]]

[R] time difference bug?

2008-08-14 Thread Bill Szkotnicki
Hi, I am computing some time differences. Using the linux version of R 2.7.1 And I am getting a strange result ( see below ) I need the difference in minutes. Actually looking for where it is NOT 15 minutes. Would anyone know why this could be happening? Or should I do this another way? Bill Th

Re: [R] time difference error

2007-10-30 Thread jim holtman
I think the error message says it all. "fix" can not handle the data type of tdiff: > tdiff <-structure(c(168, NA, NA, 165, 175, 140, 191, 195, 130, 160, 135, + 165, 330, 178, 141, NA, 119, 90, 70, 99, 115, 70, 65, 90, 90, 65, 90, 75, + 85, 93, 52, 75, 60, 90, 105, 70, 65, 60, 85, 110, 65, 60,

[R] time difference error

2007-10-30 Thread Jojje Andersson
Hello! I posted this question earlier but it seems that something went wrong, so I post it again. I have a problem making a new variabel in a dataframe that consists of a time difference. It seems that the new variable gets into the dataframe but I cant look at it anymoore. Here is what happens.

[R] time difference error

2007-10-29 Thread Jojje Andersson
Hello! I have a problem making a new variabel in a dataframe that consists of a time difference. It seems that the new variable gets into the dataframe but I cant look at it anymoore. Here is what hapens. > tdiff<- difftime(Kontrolltid, Starttid, units="auto")> tdiffTime differences > i