From b866a0ec76bb3272ba752105d055fae89d1abd6b Mon Sep 17 00:00:00 2001 From: Matthieu Date: Tue, 13 Sep 2022 15:20:27 +0200 Subject: [PATCH] Ensure data is data frame and not tibble, fixes #75 --- R/utils.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/utils.R b/R/utils.R index 99c7347..3950b55 100644 --- a/R/utils.R +++ b/R/utils.R @@ -66,6 +66,10 @@ panel.matrices = function(panel, unit = 1, time = 2, outcome = 3, treatment = 4, if (!is.data.frame(panel)){ stop("Unsupported input type `panel.`") } + ## ensure the data is data frame and not tibble, see https://github.com/synth-inference/synthdid/issues/75 + if(inherits(panel, "tbl_df")){ + panel <- as.data.frame(panel) + } if (anyNA(panel)) { stop("Missing values in `panel`.") }