Bearing Peter's warning in mind, the {anytime} package can be useful in this
example:

library(anytime)
DFX$dnew <- anydate(DFX$ddate)
DFX
# First three strings are ambiguous
# Also, string 5 is only OK if its assumed to be the same format as
strings 4 & 6.

# Can add a specific format to those anytime() uses:
getFormats()
addFormats(c("%d-%m-%y"))

DFX$dnew <- anydate(DFX$ddate)
DFX

Cheers
David Luckett
djluck...@gmail.com
0408 750 703

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to