I am working through the book 'R for dummies', 2nd Edition, John Wiley & Sons, Inc. In chapter 6 you try adding time information into the vector but the shown code is not working:
Book:
apollo <- "July 20, 1969, 20:17:39"
apollo.fmt <- "%B %d, %Y, %H:%M:%S"
xct <- as.POSIXct(apollo, format = apollo.fmt, tz = "UTC")
xct
#> [1] "1969-07-20 20:17:39 UTC"
My try:
apollo <- "July 20, 1969, 20:17:39"
apollo.fmt <- "%B %d, %Y, %H:%M:%S"
xct <- as.POSIXct(apollo, format = apollo.fmt, tz = "UTC")
xct
#> [1] NA
Anyone knows what I am doing wrong, and what should be the right code?