ben519 / mltools

Exploratory and diagnostic machine learning tools for R
Other
72 stars 26 forks source link

added data.table check in sparsify.R #20

Closed shuckle16 closed 3 years ago

shuckle16 commented 3 years ago

Hello, thank you for your work on this package!

I was using sparsify the other day and accidentally input a data.frame, resulting in this error message.

library(mltools)
sparsify(iris)
#> Error in `[.data.frame`(dt, , cols.numeric, with = FALSE): unused argument (with = FALSE)

so I went and added the additional check is.data.table to sparsify.R for a clearer error.

Ran devtools::test() and all was good!

Thanks again!

ben519 commented 3 years ago

Thank you for this!