Closed sanjmeh closed 2 years ago
Not reproducible.
$ R -q --vanilla -e "data.table::as.data.table(mean)"
> data.table::as.data.table(mean)
Error in as.data.frame.default(x, ...) :
cannot coerce class '"function"' to a data.frame
Calls: <Anonymous> ... as.data.table -> as.data.frame -> as.data.frame.default
Execution halted
I note you have other packages attached which are likely at least part of the reason you are getting the arcane error message. I tried attaching a few of them but could not reproduce. If you're able to narrow down a minimal number of packages which when attached trigger your error (and you can't see anything obvious wrong with the packages themselves), feel free to reopen.
All right, so if it is not replicable then it must be a package clash. Strange though as it is a single function use case.
please update data.table -- I believe you're experiencing a known bug that's been fixed
as.data.table()
returns an incredibly complicated error sending people into a tizzy if you pass any function to it by mistake. The above error message should be reserved for deep recursion or any memory stack overflow. It is certainly coming from C.Perhaps we can just trap the input (if a function type) and return a more relevant error, like:
#
Output of sessionInfo()