title: Error in class(x) while creating panel data using plm function
body: <p>I'm trying to create a Panel data using the plm function for pooling a model from a balanced Panel data that I imported from Excel.</p>
  
  <p>When I run the code I get the following error:</p>
  
  <blockquote>
    <p>Error in class(x) &lt;- setdiff(class(x), "pseries") :    invalid to set
    the class to matrix unless the dimension attribute is of length 2 (was
    0)</p>
  </blockquote>
  
  <pre><code>library(plm)
  library(readxl)
  library(tidyr)
  library(rJava)
  library(xlsx)
  library(xlsxjars)
  
  all_met&lt;- read_excel("data.xlsx", sheet = "all_met")
  attach(all_met)
  
  Y_all_met &lt;- cbind(methane)
  X_all_met &lt;- cbind(gdp, ecogr, trade)
  
  pdata_all_met &lt;- plm.data(all_met, index=c("id","time"))
  
  pooling_all_met &lt;- plm(Y_all_met ~ X_all_met, data=pdata_all_met, model= "pooling")
  </code></pre>
  
  <p>After running the code I was supposed to get summary statistics of a pooled ols regression of my data. Can someone tell me how I can fix this issue? Thanks in advance.</p>