I'm trying to convert a table column (aifstime_local) containing dates which are currently stored as numbers into datetime. see below for table.
aifstime_utc aifstime_local lat lon apparent_t cloud cloud_base_m
1 20190224230000 20190225083000 -12.6099 131.0474 31.8 - NULL
2 20190224223000 20190225080000 -12.6099 131.0474 30.9 - NULL
3 20190224220000 20190225073000 -12.6099 131.0474 30.1 - NULL
4 20190224213000 20190225070000 -12.6099 131.0474 30.2 - NULL
5 20190224210000 20190225063000 -12.6099 131.0474 30.2 - NULL
6 20190224203000 20190225060000 -12.6099 131.0474 29.4 - NULL
I've tried using the anytime function from the anytime package
library(anytime)
MyData$aifstime_local <- anytime(MyData$aifstime_local)
However this only returns the date, and not the datetime as I need, See below
aifstime_utc aifstime_local lat lon apparent_t cloud cloud_base_m
1 20190224230000 2019-02-25 -12.6099 131.0474 31.8 - NULL
2 20190224223000 2019-02-25 -12.6099 131.0474 30.9 - NULL
3 20190224220000 2019-02-25 -12.6099 131.0474 30.1 - NULL
4 20190224213000 2019-02-25 -12.6099 131.0474 30.2 - NULL
5 20190224210000 2019-02-25 -12.6099 131.0474 30.2 - NULL
6 20190224203000 2019-02-25 -12.6099 131.0474 29.4 - NULL
Are there any functions that can help with this task?