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 <[email protected]> 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
> [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