0

In the original data frame

enter image description here

I converted the last column to POSIXct using the following command:

ordered$Start.Time <- strptime(ordered$Start.Time, format = "%I:%M %p")

But after converting, an extra date string is adding to every rows

enter image description here

Please help me to remove the date string which has been added automatically to the time string.

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213

1 Answers1

1

As it is a POSIXct/POSIXlt format, it would have the Date as well. The prefix can be removed with format

ordered$Start.Time <- format(ordered$Start.Time, "%H:%M:%S")
akrun
  • 874,273
  • 37
  • 540
  • 662