I have a variable in the correct POSIXct format, converted using ymd_hms (DateTime) {lubridate}. However, after the conversion, the variable loses its POSIXct format:
daily$DateTime<- ifelse(daily$ID %in% "r1_1"|daily$ID %in% "r1_2", NA,daily$DateTime)
I am trying to convert the variable again to POSIXct with lubridate, but it seems like NA doesn’t like it, and besides, now the DateTime variable has num format, which lubridate does not recognize as date and time format (e.g. 1377419400).
Please any help to make the necessary conversion to convert to NA DateTime when id == r1_1 and r1_2 ??
thanks
source share