title: Repeat command automatically for other time series
body: <p>I have a data consists of 16 obs. and 30 variables and I want to apply ADF test for each column. the data called <code>test1</code> and first column is called <code>TBdu_jp</code></p>
  
  <p>My codes:</p>
  
  <pre><code>library(tseries)
  library(urca)
  library(vars)
  TBdu_jp &lt;- ts(test1$TBdu_jp, start = 1999, end = 2014, frequency = 1)
  TBdu_jp &lt;- log(TBdu_jp)
  adf1 &lt;- summary(ur.df(TBdu_jp, type = "none", lags = 0))
  adf_lag0 &lt;- summary(ur.df(TBdu_jp, type = "none", lags = 0))
  adf_lag0 &lt;- summary(ur.df(TBdu_jp, type = "trend", lags = 0))
  adf_lag0 &lt;- summary(ur.df(TBdu_jp, type = "none", lags = 0))
  adf_lag0_t &lt;- summary(ur.df(TBdu_jp, type = "trend", lags = 0))
  adf_lag0_d &lt;- summary(ur.df(TBdu_jp, type = "drift", lags = 0))
  adf_lag0_d1 &lt;- summary(ur.df(diff(TBdu_jp,differences = 1), type = "none", lags = 0))
  adf_lag0_d2 &lt;- summary(ur.df(diff(TBdu_jp,differences = 2), type = "none", lags = 0))
  adf_lag0_d1_t &lt;- summary(ur.df(diff(TBdu_jp,differences = 1), type = "trend", lags = 0))
  adf_lag0_d2_t &lt;- summary(ur.df(diff(TBdu_jp,differences = 2), type = "trend", lags = 0))
  adf_lag0_d1_dr &lt;- summary(ur.df(diff(TBdu_jp,differences = 1), type = "drift", lags = 0))
  adf_lag0_d2_dr &lt;- summary(ur.df(diff(TBdu_jp,differences = 2), type = "drift", lags = 0))
  </code></pre>
  
  <p>is there a command that allow me to repeat the same commands for the rest of the columns automatically?</p>
  
  <p>also, is it possible to make the same commands but for different number of lags for example for 1, 2, 3 and 4 number of lags without rewrite the codes again?</p>