title: using mutate_if() to convert S3: POSIXct variables to character (chr) variables in R
body: <p>I am wondering why the following <code>dplyr::mutate_if()</code> doesn't work?</p>
  
  <ol>
  <li>Create <code>flights_df</code> with dates in <code>S3: POSIXct</code> format as done <a href="http://r4ds.had.co.nz/dates-and-times.html#creating-datetimes" rel="nofollow noreferrer">here</a>
  <code>
  flights &lt;- nycflights13::flights
  make_datetime_100 &lt;- function(year, month, day, time) {
   make_datetime(year, month, day, time %/% 100, time %% 100)
  }
  flights_df &lt;- flights %&gt;%
   sample_n(100) %&gt;% 
   filter(!is.na(dep_time), !is.na(arr_time)) %&gt;%
   mutate(
        dep_time = make_datetime_100(year, month, day, dep_time),
        arr_time = make_datetime_100(year, month, day, arr_time),
        sched_dep_time = make_datetime_100(year, month, day, sched_dep_time),
        sched_arr_time = make_datetime_100(year, month, day, sched_arr_time)) %&gt;%
    dplyr::select(origin, dest, ends_with("delay"), ends_with("time"))`
  </code></li>
  </ol>
  
  <p>Now use <code>mutate_if()</code> to convert dates to characters as seen <a href="http://dplyr.tidyverse.org/reference/summarise_all.html" rel="nofollow noreferrer">here</a></p>
  
  <p><code>
  flights_df %&gt;% as_tibble() %&gt;% mutate_if(is.Date, as.character)
  </code></p>