I’m trying to change a tibble column (date) from a character vector to a POSIXct vector, however when I run my code it turns all the values into NAs.
##My tibble
print(data, n=3)
A tibble: 130 × 2
date value
1 3/21/2024 10:30:00 20.11
2 3/21/2024 10:30:30 20.11
3 3/21/2024 10:31:00 20.11
##The code I tried running. I expected this to change the date column to a POSIXct vector from a character vector.
as.POSIXct(x=data$date, format=(“%d/%m/%Y %H:%M:%S”))
[1] NA NA NA …
Jarksoon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.