Carol Gao <carol.gaox <at> 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(x, "%H:%M:%S.000))*, but apperantly that doesn't work. > > Carol Gao > > [[alternative HTML version deleted]] > >
I found this: http://tolstoy.newcastle.edu.au/R/e6/help/09/05/15738.html It seems to me that this is partly an options issue. Maybe this is something to work with: options(digits.secs=3) strptime(x, "%H:%M:%S%OS") ______________________________________________ R-help@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.