Alexander Salim
2010-Dec-03 15:31 UTC
[R] Date-time Conversion from Numeric Representations
Hi all, I have a dataset called ,dataSet1'. The time column is given in a numeric code beginning with the year and ending with the minutes. Frist I tried the strptime() function to solve the problem. It gave me just the date back (and not the date and time). There is also the ISOdatetime function which didn't work either. I created a dump file which I detached to this mail with the objects ,dataSet1' and ,problem'. Thank you very much for your help. Alex
On 03.12.2010 16:31, Alexander Salim wrote:> Hi all, > > I have a dataset called ,dataSet1'. The time column is given in a numeric > code beginning with the year and ending with the minutes. Frist I tried the > strptime() function to solve the problem. It gave me just the date back (and > not the date and time). There is also the ISOdatetime function which didn't > work either. I created a dump file which I detached to this mail with the > objects ,dataSet1' and ,problem'.strptime(x, "%Y%m%d%H%M") should do the trick (without seeing the data). But if you copy just one entry to your message, I could have been sure (the attachtment did not make it and is not required if you just insert a short example into your message)... Uwe Ligges> Thank you very much for your help. > > Alex > > > > > ______________________________________________ > 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.