ecm function checks whether xeq and xtr parameter is of class "data.frame". However, there are packages (e.g. readxl) which return richer data.frame instance. The data.frame is also tbl and also tbl_df (so the result is actually 3 classes).
Could you please change this:
if (class(xtr) != "data.frame" | class(xeq) != "data.frame") {
to something like this:
if (!inherits(xtr,"data.frame") | !inherits(xeq, "data.frame")) {
ecm function checks whether xeq and xtr parameter is of class "data.frame". However, there are packages (e.g. readxl) which return richer data.frame instance. The data.frame is also tbl and also tbl_df (so the result is actually 3 classes).
Could you please change this: if (class(xtr) != "data.frame" | class(xeq) != "data.frame") {
to something like this: if (!inherits(xtr,"data.frame") | !inherits(xeq, "data.frame")) {
It would make our lives much easier. Thanks!