I'm fairly new to using R and I have a numeric date variable in my dataset that is quite difficult to convert to standard as.Date format in R.
Currently, the Date variable includes a numeric value with 11 numbers and I have tried using several examples of code on how to convert the date variable. However, for some reason no code is able to convert the year correctly, the months and day are correctly converted but not the actual year.
#
df$Date <- data.frame(column = c(13643596800, 13671590400, 13674441600, 13655088000,
13776220800, 13700793600, 13684118400, 13662172800, 13691116800))
# I have tried several version of as.Date, as_date and as_datetime.
df$Date <- as.Date(df$column, origin = "1970-01-01")
As evident from the code, the code is incorrectly converting the year variable. Would appreciate all the help I can get.