title: R: converting POSIXct to minutes
body: <p>I have the following data:</p>
  
  <pre><code>library(tidyverse)
  
  d1 &lt;- data_frame(
  time= c("1899-12-31 02:21:00 UTC", "1899-12-31 05:56:00 UTC"),
  number = c(1, 2))
  </code></pre>
  
  <p>I would like to be able to covert the time variable to be in minutes in a new column so that the dataframe looks like this:</p>
  
  <pre><code>d1 &lt;- data_frame(
  time= c("1899-12-31 02:21:00 UTC", "1899-12-31 05:56:00 UTC"),
  number = c(1, 2),
  minutes = c("141", "356"))
  </code></pre>
  
  <p>I can do this using <code>lubridate</code> if my time variable is <code>02:21:00</code> and <code>05:56:00</code> however when I'm using <code>read_excel()</code> to load in the data it's turning my variable into <code>POSIXct</code>, eg <code>1899-12-31 02:21:00 UTC</code> and <code>1899-12-31 05:56:00 UTC</code> which is making it hard to convert.</p>
  
  <p>I need to use <code>read_excel()</code> to read the data in so it's not an option to convert to a .csv and do it that way (which would stop it reading it as a <code>POSIXct</code>).</p>