title: How to figure out where new NaNs are coming from - R
body: <pre><code>Total_Time &lt;- function(TT_column){
  z &lt;- dmy_hms(TT_column)
  hr &lt;- hour(z)
  min &lt;- minute(z)
  sec &lt;- second(z)
  x &lt;- hr*60 + min + sec/60 # No need to extract days as the maximum value is 13 hours
  x
  }
  
  df$TT.Col_1 &lt;- Total_Time(df$T.Col_1)
  sum(is.na(df)) # 0
  df$TT.Col_2 &lt;- Total_Time(df$T.Col_2)
  sum(is.na(df)) # 0
  df$TT.Col_3 &lt;- Total_Time(df$T.Col_3)
  sum(is.na(df)) # 0
  df$TT.Col_4 &lt;- Total_Time(df$T.Col_4)
  sum(is.na(df)) # 0
  df$TT.Col_5 &lt;- Total_Time(df$T.Col_5)
  sum(is.na(df)) # 5
  df$TT.Col_6 &lt;- Total_Time(df$T.Col_6)
  sum(is.na(df)) # 7
  </code></pre>
  
  <p>I'm trying to figure out where come from those NaN values with <code>tryCatch()</code> but I can't figure out a way to use <code>tryCatch()</code> with those specific columns (<code>TT.Col_5</code> and <code>TT.Col_6</code>).</p>
  
  <p>Some context: <code>T.Col_X</code> are character times values (<code>dd/mm/yyyy hh:mm:ss</code>) which are converted to minutes as they start in <code>30/12/1899 00:00:00</code> as 0 hours, 0 minutes, and 0 seconds passed. <code>Total_Time</code> is the function that convert those values and it restores them in <code>TT.Col_X</code></p>