[datatable-help] Error in a package that imports data.table
Victor Kryukov
victor.kryukov at gmail.com
Mon Mar 4 07:32:36 CET 2013
Hi Matthew,
my DESCRIPTION file has the following section:
Imports:
data.table,
lubridate
and my (generated) NAMESPACE contains
export(ProcessTransactionSurvey)
import(data.table)
import(lubridate)
My R CMD CHECK (run with check() from devtools) mostly runs OK but fails at the end with the following error, which is expected since I haven't created any documentation yet. I'm not sure yet have to fix this LaTeX warning (I do have latex installed on my machine).
* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
* checking PDF version of manual without hyperrefs or index ... ERROR
Error: Command failed (1)
Anything else I should check?
Victor
On Mar 3, 2013, at 3:26 PM, Matthew Dowle <mdowle at mdowle.plus.com> wrote:
>
> 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
>> datatable-help at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
More information about the datatable-help
mailing list