I have a data frame that looks something like this:
tbl <- data.frame(ISO_Timestamp = c(1612972204, 1612972214, 1612972224, 1612972234), S1 = c(7056, 7101.1, 5145, 2198))
I want to convert the ISO_timestamp column into a date-time POSIXt format. I am able to convert single ISO_Timestamp timestamp objects like this:
lubridate::as_datetime(1612988995)
[1] "2021-02-10 20:29:55 UTC"
I tried this to convert the entire column but it is not working.
data_1 <- tbl %>%
mutate(date_time = as_datetime(`ISO_Timestamp`))
I am getting the following error:
Warning messages:
1: Problem with `mutate()` input `date_time`.
x All formats failed to parse. No formats found.
ℹ Input `date_time` is `as_datetime(`ISO_Timestamp`)`.
2: All formats failed to parse. No formats found.
What am I doing wrong?