Skip to content
Prev 387436 / 398502 Next

How to plot dates

My computer is an Apple MacBook. I do not have POSIX. 
The command
myDat$datetime <- as.POSIXct(myDat$datetime, tz = "", format = "%Y-%M-%d %H:%M:%OS")
yields the error
Error in `$<-.data.frame`(`*tmp*`, datetime, value = numeric(0)) : 
  replacement has 0 rows, data has 13
Please advise, How to proceed?
Greg Coats
X2021.03.11.10.00.00
1  2021-03-11 14:17:00
2  2021-03-12 05:16:46
3  2021-03-12 09:17:02
4  2021-03-12 13:31:43
5  2021-03-12 22:00:32
6  2021-03-13 09:21:43
Error in `$<-.data.frame`(`*tmp*`, datetime, value = numeric(0)) : 
  replacement has 0 rows, data has 13