[datatable-help] Import problem with data.table in packages

Matthew Dowle mdowle at mdowle.plus.com
Sat May 11 01:41:43 CEST 2013


Hi Ken, Victor,

Have read up again about .onAttach and .onLoad and I think data.table 
is
using them correctly after all.  So Ken's patch alone should indeed fix 
the
problem.  I've closed #975 now. R-Forge has now (finally) built and is
passing with that patch applied.

fread also has colClasses now, if anyone is waiting for that.

Many thanks,
Matthew


On 07.05.2013 10:18, Matthew Dowle wrote:
> Hi Ken,
> cc Victor
>
> Many thanks. I've just applied and committed your patch. I suspect a
> change from .onLoad to .onAttach may still be needed but let's make
> one change at a time. There's a comment in the code that suggests it
> was in .onAttach originally and I'd moved it to .onLoad.  I wonder if
> it didn't work in .onAttach because of the lack of "data.table::"
> prefix. Now that's there, perhaps it can move back to .onAttach.
>
> Also filed so as not to forget :
>
>
> 
> https://r-forge.r-project.org/tracker/index.php?func=detail&aid=2771&group_id=240&atid=975
>
> R-Forge should build the patched version in the next few hours.
> Please let us know if it fixes it or not.
>
> Matthew
>
>
> On 06.05.2013 22:29, Ken Williams wrote:
>>> -----Original Message-----
>>> From: datatable-help-bounces at lists.r-forge.r-project.org 
>>> [mailto:datatable-
>>> help-bounces at lists.r-forge.r-project.org] On Behalf Of Ken Williams
>>> Sent: Monday, May 06, 2013 4:27 PM
>>> To: Matthew Dowle
>>> Cc: datatable-help at lists.r-forge.r-project.org
>>> Subject: Re: [datatable-help] Import problem with data.table in 
>>> packages
>>>
>>>
>>>
>>> > -----Original Message-----
>>> > From: Matthew Dowle [mailto:mdowle at mdowle.plus.com]
>>> > Sent: Wednesday, May 01, 2013 4:13 PM
>>> > To: Ken Williams
>>> > Cc: datatable-help at lists.r-forge.r-project.org
>>> > Subject: Re: [datatable-help] Import problem with data.table in
>>> > packages
>>> >
>>> >
>>> > Hi,
>>> >
>>> > This rings a bell actually. data.table uses .onLoad currently but 
>>> it
>>> > should be using .onAttach, I seem to recall.
>>> >
>>> >
>>> > 
>>> http://r.789695.n4.nabble.com/Error-in-a-package-that-imports-data-tab
>>> > le-
>>> > tp4660173p4660637.html
>>> >
>>> > I had a hunt around but couldn't find if we decided data.table 
>>> should
>>> > move from .onLoad to .onAttach.  Does anyone know/remember?
>>>
>>> I'm not sure - but maybe a solution would be to explicitly prefix 
>>> the package
>>> name:
>>
>> [...]
>>
>> Sorry, didn't notice the backticks - the second patched line should
>> probably go like so:
>>
>>
>> -        ss[[2]] = parse(text="if (inherits(..1,'data.table'))
>> return(`.rbind.data.table`(...))")[[1]]
>> +        ss[[2]] = parse(text="if (inherits(..1,'data.table'))
>> return(data.table::.rbind.data.table(...))")[[1]]
>>
>>
>>  -Ken
>>
>> ________________________________
>>
>> CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of
>> the intended recipient(s) and may contain confidential and 
>> privileged
>> information. Any unauthorized review, use, disclosure or 
>> distribution
>> of any kind is strictly prohibited. If you are not the intended
>> recipient, please contact the sender via reply e-mail and destroy 
>> all
>> copies of the original message. Thank you.



More information about the datatable-help mailing list