ycroissant / plm

Panel Data Econometrics with R
GNU General Public License v2.0
49 stars 13 forks source link

Error in is.recursive(.$object) && !is.primitive(.$object) && n > 0 : 'length = 2' in coercion to 'logical(1)' #54

Closed UniNielsen closed 4 months ago

UniNielsen commented 4 months ago

I keep getting the same error message, when I use the view command for my plm models. Summary() works. The same error message appears, when I do "Run examples":

data("Produc", package = "plm") zz <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, index = c("state","year")) View(zz) Error in is.recursive(.$object) && !is.primitive(.$object) && n > 0 : 'length = 2' in coercion to 'logical(1)'

I am using R 4.3.3. and all packages are updated.

tappek commented 4 months ago

Looking at View´s documentation we find:

Invoke a spreadsheet-style data viewer on a matrix-like R object.

So, we should not expect View to work on an estimated model object as it is not matrix-like.

What works is, e.g., View(zz$coefficients) as zz$coefficients that is a numeric and View(summary(zz)$coefficients) as summary(zz)$coefficients is a matrix.