-2
I have a column in this format and I can’t convert it to date. At this time it is in hours. Example: 8.5 is actually 08:30:00 and so on... Any idea how to do it? (see image)
start_date <- as.POSIXct(data$START, format = "%Y-%m-%d %H")
data <- mutate(data, START=start_date)
end_date <- as.POSIXct(data$END, format = "%Y-%m-%d %H")
data <- mutate(data, END=end_date)
When writing the code in this format what happens is that it "ignores" half hours, that is, for example, in the first line instead of Put 08:30:00 puts 08:00:00.
Post a sample of your data as text (for example, using
dput
- see the topic on minimum reproducible examples in the website help).– Carlos Eduardo Lagosta