gaurbans / ecm

R package 'ecm'
3 stars 1 forks source link

data.frame detection does not consider inheritance #2

Closed ladislavlencucha closed 3 years ago

ladislavlencucha commented 3 years ago

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!

gaurbans commented 3 years ago

Has been updated and the new version (5.1.0) will be on cran shortly. Thanks for the suggestion!