Weird error in package with older data.table version

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird error in package with older data.table version

szehnder@uni-bonn.de
I am having a weird error in a package I wrote some time ago with an older data.table version. ‘fread’ gives:

Internal error: attempt to bump from type 0 to type 1. Please report to datatable-help

The data is the same that I read in before. Any ideas?


Best

Simon

_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Reply | Threaded
Open this post in threaded view
|

Re: Weird error in package with older data.table version

szehnder@uni-bonn.de
Ok, what I found out so far is the following:

Column 9 (containing characters in the .csv-file) is read first as LGL (logical I think) because the character in the first rows of this column is just ’T’ (and ‘fread' reads T/True/TRUE as TRUE). After some lines there comes a ‘C’ and now this column cannot be anymore logical (LGL) but has to be character. Therefore this column gets bumped and the program stops.

As the ordering of columns can change in my package I need to tell ‘fread', that it should not consider LGL at all - is that possible? I would like to avoid to bother the user by asking him to provide colClasses.

My data sample is always the TRACE data but I cannot know what variables of the TRACE data a user has retrieved. So my only idea to avoid the above mentioned error in my fread would be:

1. Read column names via ’scan’.

2. Check what variables are in and then choose via key/value pairs the appropriate colClasses and use them in ‘fread’.

Any other suggestions?


Best

Simon
 
On 12 Mar 2014, at 20:28, Simon Zehnder <[hidden email]> wrote:

> I am having a weird error in a package I wrote some time ago with an older data.table version. ‘fread’ gives:
>
> Internal error: attempt to bump from type 0 to type 1. Please report to datatable-help
>
> The data is the same that I read in before. Any ideas?
>
>
> Best
>
> Simon
>
> _______________________________________________
> datatable-help mailing list
> [hidden email]
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Reply | Threaded
Open this post in threaded view
|

Re: Weird error in package with older data.table version

szehnder@uni-bonn.de
My idea below made everything work … problem solved.

Best

Simon

On 13 Mar 2014, at 09:18, Simon Zehnder <[hidden email]> wrote:

> Ok, what I found out so far is the following:
>
> Column 9 (containing characters in the .csv-file) is read first as LGL (logical I think) because the character in the first rows of this column is just ’T’ (and ‘fread' reads T/True/TRUE as TRUE). After some lines there comes a ‘C’ and now this column cannot be anymore logical (LGL) but has to be character. Therefore this column gets bumped and the program stops.
>
> As the ordering of columns can change in my package I need to tell ‘fread', that it should not consider LGL at all - is that possible? I would like to avoid to bother the user by asking him to provide colClasses.
>
> My data sample is always the TRACE data but I cannot know what variables of the TRACE data a user has retrieved. So my only idea to avoid the above mentioned error in my fread would be:
>
> 1. Read column names via ’scan’.
>
> 2. Check what variables are in and then choose via key/value pairs the appropriate colClasses and use them in ‘fread’.
>
> Any other suggestions?
>
>
> Best
>
> Simon
>
> On 12 Mar 2014, at 20:28, Simon Zehnder <[hidden email]> wrote:
>
>> I am having a weird error in a package I wrote some time ago with an older data.table version. ‘fread’ gives:
>>
>> Internal error: attempt to bump from type 0 to type 1. Please report to datatable-help
>>
>> The data is the same that I read in before. Any ideas?
>>
>>
>> Best
>>
>> Simon
>>
>> _______________________________________________
>> datatable-help mailing list
>> [hidden email]
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
> _______________________________________________
> datatable-help mailing list
> [hidden email]
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Reply | Threaded
Open this post in threaded view
|

Re: Weird error in package with older data.table version

Matthew Dowle
What do you mean by older data.table version, which one?  Can you
upgrade to v1.9.2?

 > Therefore this column gets bumped and the program stops.

It shouldn't stop.  It should bump the column and continue. That's what
happens for me.  Could be a bug then,  which is why it's confusing
talking about an older version of data.table. Thinking about it, maybe
those bump warning messages should be downgraded to verbose=TRUE
output.    It might be stopping if you've set options(warn=2).

Matt

On 14/03/14 12:01, Simon Zehnder wrote:

> My idea below made everything work … problem solved.
>
> Best
>
> Simon
>
> On 13 Mar 2014, at 09:18, Simon Zehnder <[hidden email]> wrote:
>
>> Ok, what I found out so far is the following:
>>
>> Column 9 (containing characters in the .csv-file) is read first as LGL (logical I think) because the character in the first rows of this column is just ’T’ (and ‘fread' reads T/True/TRUE as TRUE). After some lines there comes a ‘C’ and now this column cannot be anymore logical (LGL) but has to be character. Therefore this column gets bumped and the program stops.
>>
>> As the ordering of columns can change in my package I need to tell ‘fread', that it should not consider LGL at all - is that possible? I would like to avoid to bother the user by asking him to provide colClasses.
>>
>> My data sample is always the TRACE data but I cannot know what variables of the TRACE data a user has retrieved. So my only idea to avoid the above mentioned error in my fread would be:
>>
>> 1. Read column names via ’scan’.
>>
>> 2. Check what variables are in and then choose via key/value pairs the appropriate colClasses and use them in ‘fread’.
>>
>> Any other suggestions?
>>
>>
>> Best
>>
>> Simon
>>
>> On 12 Mar 2014, at 20:28, Simon Zehnder <[hidden email]> wrote:
>>
>>> I am having a weird error in a package I wrote some time ago with an older data.table version. ‘fread’ gives:
>>>
>>> Internal error: attempt to bump from type 0 to type 1. Please report to datatable-help
>>>
>>> The data is the same that I read in before. Any ideas?
>>>
>>>
>>> Best
>>>
>>> Simon
>>>
>>> _______________________________________________
>>> datatable-help mailing list
>>> [hidden email]
>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>> _______________________________________________
>> datatable-help mailing list
>> [hidden email]
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
> _______________________________________________
> datatable-help mailing list
> [hidden email]
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>

_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Reply | Threaded
Open this post in threaded view
|

Re: Weird error in package with older data.table version

szehnder@uni-bonn.de
Hi Matt,

the ‘older version’ was 1.8.10. With the newer version it bumps and stops. No change there (options(warn = 2)) ….only if I give colClasses it runs through.

Best

Simon

On 14 Mar 2014, at 15:13, Matt Dowle <[hidden email]> wrote:

> What do you mean by older data.table version, which one?  Can you upgrade to v1.9.2?
>
> > Therefore this column gets bumped and the program stops.
>
> It shouldn't stop.  It should bump the column and continue. That's what happens for me.  Could be a bug then,  which is why it's confusing talking about an older version of data.table. Thinking about it, maybe those bump warning messages should be downgraded to verbose=TRUE output.    It might be stopping if you've set options(warn=2).
>
> Matt
>
> On 14/03/14 12:01, Simon Zehnder wrote:
>> My idea below made everything work … problem solved.
>>
>> Best
>>
>> Simon
>>
>> On 13 Mar 2014, at 09:18, Simon Zehnder <[hidden email]> wrote:
>>
>>> Ok, what I found out so far is the following:
>>>
>>> Column 9 (containing characters in the .csv-file) is read first as LGL (logical I think) because the character in the first rows of this column is just ’T’ (and ‘fread' reads T/True/TRUE as TRUE). After some lines there comes a ‘C’ and now this column cannot be anymore logical (LGL) but has to be character. Therefore this column gets bumped and the program stops.
>>>
>>> As the ordering of columns can change in my package I need to tell ‘fread', that it should not consider LGL at all - is that possible? I would like to avoid to bother the user by asking him to provide colClasses.
>>>
>>> My data sample is always the TRACE data but I cannot know what variables of the TRACE data a user has retrieved. So my only idea to avoid the above mentioned error in my fread would be:
>>>
>>> 1. Read column names via ’scan’.
>>>
>>> 2. Check what variables are in and then choose via key/value pairs the appropriate colClasses and use them in ‘fread’.
>>>
>>> Any other suggestions?
>>>
>>>
>>> Best
>>>
>>> Simon
>>>
>>> On 12 Mar 2014, at 20:28, Simon Zehnder <[hidden email]> wrote:
>>>
>>>> I am having a weird error in a package I wrote some time ago with an older data.table version. ‘fread’ gives:
>>>>
>>>> Internal error: attempt to bump from type 0 to type 1. Please report to datatable-help
>>>>
>>>> The data is the same that I read in before. Any ideas?
>>>>
>>>>
>>>> Best
>>>>
>>>> Simon
>>>>
>>>> _______________________________________________
>>>> datatable-help mailing list
>>>> [hidden email]
>>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>>> _______________________________________________
>>> datatable-help mailing list
>>> [hidden email]
>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>> _______________________________________________
>> datatable-help mailing list
>> [hidden email]
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>>
>

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