The data I\'m trying to convert is supposed to be a date, however it is formatted as mmddyyyy with no separation by dashes or slashes. In order to work with dates in R, I wo
Have a look at lubridate mdy function
require(lubridate)
a <- "10281994"
mdy(a)
gives you
[1] "1994-10-28 UTC"
of class "POSIXct" "POSIXt" so a datetime in R. (thanks Joshua Ulrich for the correction)
You could use as.Date(mdy(a)) = 1994-10-28 to get a Object of class Date.
There are mutations like ymd and dmy within lubridate as well.