title: lag/lead entire dataframe in R
body: <p>I am having a very hard time leading or lagging an entire dataframe. What I am able to do is shifting individual columns with the following attempts but not the whole thing:</p>
  
  <pre><code>require('DataCombine')
  df_l &lt;- slide(df, Var = var1, slideBy = -1)
  </code></pre>
  
  <p>using colnames(x_ret_mon) as Var does not work, I am told the variable names are not found in the dataframe.</p>
  
  <p>This attempt shifts the columns right but not down:</p>
  
  <pre><code> df_l&lt;- dplyr::lag(df)
  </code></pre>
  
  <p>This only creates new variables for the lagged variables but then I do not know how to effectively delete the old non lagged values:</p>
  
  <pre><code> df_l&lt;-shift(df, n=1L, fill=NA, type=c("lead"), give.names=FALSE)
  </code></pre>