title: R codes to remove any rows that has zero values
body: <p>I need someone to help me to delete the rows that has zero values by using R </p>
  
  <p>R codes:</p>
  
  <pre><code>library(glmnet)
  library(forecast)
  library(Hmisc)
  set.seed(54321)
  nsim &lt;- 10
  n &lt;- 50
  phi &lt;- c(0.5,-0.2)
  coeffs &lt;- matrix(0L, nrow=nsim, ncol=2)
  for (i in 1: nsim) {
      xt &lt;- unclass(arima.sim(n=n,list(ar=phi),innov=rnorm(n,0,1)))
      x.lag1 &lt;- Lag(xt, shift=1)
      x.lag2 &lt;- Lag(xt, shift=2)
      x &lt;- matrix(xt)
      xt_1 &lt;- matrix(x.lag1, ncol=1)
      xt_2 &lt;- matrix(x.lag2, ncol=1)
      data &lt;- cbind(x, 0, xt_1, xt_2)
      cv.lasso2 &lt;- cv.glmnet(data[3:n,2:4],
      data[3:n,1],
      intercept=FALSE,
      alpha=1)
      coeff &lt;- coef(cv.lasso2, s=cv.lasso2$lambda.min)
      coeffs[i,] &lt;- c(coeff[3],coeff[4])
      print(coeffs[i,])
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[1]  0.7235772 -0.2384828
  [1] 0.4173081 0.0000000
  [1]  0.7199519 -0.2195367
  [1]  0.6960947 -0.2991648
  [1]  0.7680741 -0.3498053
  [1] 0.4830431 0.0000000
  [1] 0 0
  [1] 0.38389815 0.05664054
  [1]  0.6764061 -0.1468669
  [1] 0.343469 0.000000
  </code></pre>
  
  <p>I need help with  R codes to get the following output, please</p>
  
  <pre><code> [1]  0.7235772 -0.2384828
   [1]  0.7199519 -0.2195367
   [1]  0.6960947 -0.2991648
   [1]  0.7680741 -0.3498053
   [1]  0.38389815 0.05664054
   [1]  0.6764061 -0.1468669
  </code></pre>
  
  <p>Thank you in advance</p>