title: Using Difftime function on Multiple columns of two DataFrames in R
body: <p>I have two data frames each containing timestamp columns as in the below 
  images:</p>
  
  <p>Dataframe-1:</p>
  
  <p><img src="https://i.stack.imgur.com/CcJ4T.png" alt="Dataframe-1"></p>
  
  <p>Dataframe-2:</p>
  
  <p><img src="https://i.stack.imgur.com/MoOP7.png" alt="Dataframe-2"></p>
  
  <p>I want to find the time difference between each of the respective columns of the data frames, example: Time difference between respective rows of Column1 of DF1 and respective rows of Column1 of DF2.</p>
  
  <p>I have only mentioned three columns in each of the data frame in the above image, although i have 257 columns in each of the column in my original dataset, i am currently finding the difference using the below command individually:</p>
  
  <pre><code>diff_time_1&lt;- difftime(df1$t1,df2$l1)
  diff_time_2&lt;- difftime(df1$t2,df2$l2)..so on
  </code></pre>
  
  <p>This well take a lot of effort if i try to perform for all the 257 columns, i have tried various ways by using the apply functions and for loops, but they do not seem to work.</p>
  
  <p>Kindly help me in finding a solution where i can apply the <code>difftime</code> function to the entire columns in a single go.</p>