Those numbers look like ... well, numbers. You want characters! Try
converting the integer to a character before trying to do a string
parse, e.g.:
ymd.int <- c(20050104, 20050105, 20050106, 20050107, 20050110, 20050111,
20050113, 20050114)
ymd <- as.Date(as.character(ymd.int),"%Y%m%d")
As far as the other functions you are looking at ("timeDate",
"timeRelative") -- I've never seen these, so I'm guessing they are
S-PLUS. In R, you can use "diff" or "difftime" (which works with "Date"
and "POSIXlt"-or Date-Time classes) , e.g.:
diff(ymd)
diff(ymd,2)
diff(ymd,3)
or do some arithmetic:
difftime(ymd[1],ymd[4])
difftime(ymd[1],ymd[4],unit="weeks")
Hopefully this is helpful to you!
+mt
______________________________________________
[email protected] 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.