Hi,
    Can strptime (or some other function) help me turn the following
column of a data.frame into two new columns, one as date and the other
as time, preserving the AM/PM value?

Thanks,
Mark

> B
              ENTRY DATE
1  3/23/2009 6:30:00 AM
2  3/23/2009 6:30:00 AM
3  3/23/2009 6:39:00 AM
4  3/23/2009 6:39:00 AM
5  3/23/2009 6:48:00 AM
6  3/23/2009 6:48:00 AM
7  3/23/2009 7:00:00 AM

> strftime(B, tz="", format="%m/%d/%Y %I:%M:%s %p")
Error in as.POSIXlt.default(x, tz = tz) :
  do not know how to convert 'x' to class "POSIXlt"
>

> strptime(B, format="%m/%d/%Y %I:%M:%s %p")
[1] NA
>

> mode(B)
[1] "list"
> class(B)
[1] "data.frame"
>

______________________________________________
R-help@r-project.org 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.

Reply via email to