[R] Separating Date and Time

reichm@@j m@iii@g oii sbcgiob@i@@et reichm@@j m@iii@g oii sbcgiob@i@@et
Thu Jun 20 00:13:01 CEST 2019


R-Help

 

I'm using the following code to deparate the date and time components from a
date_time varaible as follows:

 

dt1$date <- format(as.POSIXct(dt1$date_time, format = "%m/%d/%Y %H:%M"),
"%Y-%m-%d")

dt1$time <- format(as.POSIXct(dt1$date_time, format = "%m/%d/%Y %H:%M"),
"%H:%M:%S")

 

But I end up with <chr> objects. What am I missing?

 

Jeff


	[[alternative HTML version deleted]]



More information about the R-help mailing list