Try this:
> x
startdate enddate
1 27SEP2005 01JAN2006
> x$start <- as.Date(x$startdate, format="%d%b%Y")
> x$end <- as.Date(x$enddate, format="%d%b%Y")
> x
startdate enddate startend
1 27SEP2005 01JAN2006 2005-09-27 2006-01-01
> x$duration <- x$end - x$start
> x
startdate
Hi,
I have a data.frame with factors in columns like
startdate enddate
27SEP2005 01JAN2006
How can I calculate the duration between those two dates and move this in a
extra column in the data.frame.
Thanks,
André
[[alternative HTML version deleted]]
__
2 matches
Mail list logo