Open skranz opened 2 years ago
THANKS A LOT!!! Your comment really helps me!
The problem comes from unique(panel[, treatment])
, which has a different implicit behavior with respect to the implicit drop
argument
This is why length(unique(panel[, treatment]))
returns a false positive warning, compare:
df <- data.frame(treatment =c(0,1))
tib <- tibble::tibble(treatment =c(0,1))
length(unique(df[, "treatment"]))
#> [1] 2
length(unique(tib[, "treatment"]))
#> [1] 1
Created on 2022-09-12 with reprex v2.0.2
Thank you so much! This is so helpful!!
Just a short notice. The
panel.matrices
function seems to throw an error if the passedpanel
object is a tibble (the tidyverse equivalent of a data frame). Here is a simple example with resulting error message:Since tidyverse is very popular and certain dplyr operations tend to convert data frames into tibbles, this error may be encountered by some users. A simple fix would probably be to start the
panel.matrices
function with a callpanel = as.data.frame(panel)
. At least the following code works fine: