title: R - How can I add an empty POSIXct column to a data.frame / tibble which already exists?
body: <p>I can initialize a data frame with a POSIXct column with code like this:</p>
  
  <pre><code>df &lt;- data.frame(a=numeric(), b=character(), c=as.POSIXct(character()))
  </code></pre>
  
  <p>However, if I try to add an empty POSIXct column to a data.frame or tibble which already exists, the column is transformed to numeric type/class. </p>
  
  <pre><code>&gt; df &lt;- tibble("Index"=numeric(10))
  &gt; df[,"date"] &lt;- as.POSIXct(character())
  &gt; df[,"date"] %&gt;% pull %&gt;% class()
  [1] "numeric
  </code></pre>
  
  <p>Is there a method to overcome this problem?</p>