Hi,

Did you include data.table in either the Imports or Depends field of your package's DESCRIPTION file?

I've just improved data.table FAQ 6.9 to make that clearer.

If it still doesn't work, does your package fully pass "R CMD check"?

Matthew


On 03.03.2013 22:25, Victor Kryukov wrote:
Hello,

I'm developing an R package which will be used internally at my
company, and I have troubles using data.table. I'm very new to package
development and I'm not really sure whether the errors I see are
related to data.table or not, but here it is anyway.

I have a function that imports data from .csv files and cleans the
data (subsets, converting fields to numeric etc.). As the end of the
function definition, I convert the resulting data.frame to data.table
and return the result:

ProcessData <- function(…) {
        ...
        df <- data.table(df)
        df
}

When I use this function standalone, after

library(data.package)

everything works as expected. However, when I'm defining this
function as a part of a package and later call it, I'm getting the
following error:

Error in rbind(deparse.level, ...) :
  could not find function ".rbind.data.table"

Please note that in the package .R files, I'm not importing
data.table directly with library(data.package) but rather have
`import(data.table)` statement in my NAMESPACE, as recommended here
https://github.com/hadley/devtools/wiki/Namespaces.

When I import data.table directly with library(data.table) after
importing my package, everything works as expected.

I suspect there may be something going wrong with namespaces in data.table.

My environment: I'm using R 2.15.3 on Mac and have tested the above
on both data.table 1.8.6 and 1.8.7. Please let me know if I need to
provide more info. Any help will be much appreciated!

Regards,
Victor

_______________________________________________
datatable-help mailing list
[email protected]

https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to