I want to make an empty vector of POSIXct so that I can put a POSIXct in it:
POSIXct
vec <- vector(\"POSIXct\", 10) vec vec[1] <- \"2014-
I usually initialize things to NA:
NA
as.POSIXct(rep(NA, 10))
works well in this case. It's explicitly doing what happens under-the-hood in @RichardScriven's answer---see the comments there for a longer discussion.