converting column from a factor to date format YYYY-MM-DDThh:mm:ss.SSSZ
One way to do this is to use the PIPE operator to pass the column of the dataframe into your function, then assign it back to the dataframe.

I created a dataframe with one column holding your example date string five times:

&gt; x &lt;- "2014-04-06T18:42:05.823Z"
&gt; DF &lt;- as.data.frame(c(x, x, x, x, x), colnames="original")
&gt; colnames(DF) &lt;- "original"
&gt; str(DF)
'data.frame':   5 obs. of  1 variable:
 $ original: chr  "2014-04-06T18:42:05.823Z" "2014-04-06T18:42:05.823Z" 


I use this PIPE symbol, which allows you to chain methods together, passing the output from one into the input of the following. Using a . symbolises the output from the previous method.

To make the PIPE operator available, load in the magrittr package (I believe it is also included in the tidyverse, so perhaps via the dplyr package:

library(maggritr)


Now I apply the as.POSIXct function to the original column, and save it back to the dataframe in a columnn called new:

DF$new &lt;- DF$original %&gt;% as.POSIXct(., tz = "UTC", "%Y-%m-%dT%H:%M:%OS")
&gt; DF
                  original                     new
1 2014-04-06T18:42:05.823Z 2014-04-06 18:42:05.822
2 2014-04-06T18:42:05.823Z 2014-04-06 18:42:05.822
3 2014-04-06T18:42:05.823Z 2014-04-06 18:42:05.822
4 2014-04-06T18:42:05.823Z 2014-04-06 18:42:05.822
5 2014-04-06T18:42:05.823Z 2014-04-06 18:42:05.822

&gt; str(DF)
'data.frame':   5 obs. of  2 variables:
 $ original: chr  "2014-04-06T18:42:05.823Z" "2014-04-06T18:42:05.823Z" ...
 $ new     : POSIXct, format: "2014-04-06 18:42:05.822" "2014-04-06 18:42:05.822" ...


You can remove the original column if you like, using:

df$original &lt;- NULL