Thanks Gabor - sprintf did the trick
--
View this message in context:
http://n4.nabble.com/as-date-parsing-tp1582868p1584218.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailma
Try this. sprintf formats it with a leading 0 if necessary and then
as.Date processes that:
as.Date(sprintf("%06d", c(280210, 10210)), "%d%m%y")
Note Feb only has 28 days this year so I changed the example.
On Sat, Mar 6, 2010 at 10:17 AM, ManInMoon wrote:
>
> I have text date colum with dates
There are lots of ways to deal with text. One possibility would be to
check the length with nchar(), and if it is 5, use paste() to add a 0
to the beginning. Granted, not elegant.
Sarah
On Sat, Mar 6, 2010 at 10:17 AM, ManInMoon wrote:
>
> I have text date colum with dates such at 290210 which I
I have text date colum with dates such at 290210 which I can parse with
%d%m%y but I also have date without leading zeo i.e. 10210 (Ist Feb 2010)
which cause any NA.
How can I parse the second one?
--
View this message in context:
http://n4.nabble.com/as-date-parsing-tp1582868p1582868.html
Sent
4 matches
Mail list logo