[datatable-help] Bug with complex numbers

Matthew Dowle mdowle at mdowle.plus.com
Mon Dec 3 13:27:00 CET 2012


Paul,

It's not a bug: complex column types aren't yet supported.

If you'd like 'complex' support please file a feature request. If you 
can gather support and provide examples of useful applications, then 
that will help bump its priority up.

Matthew


On 03.12.2012 11:03, Paul Metzner wrote:
> Dear all,
>
> I guess I found a bug in data.table. I have a data frame with complex
> numbers which I'd like to convert to a data table for aggregation.
> Most things work, for instance:
>
>> > head(d)
>>          	Fz	       Cz	         Pz  item
>> 1: 0.002+0i 0.005+0i 0.054+0i  182
>> 2: 1.567+0i 2.263+0i 1.547+0i  182
>> 3: 0.314+0i 1.159+0i 3.841+0i  182
>> 4: 0.507+0i 3.026+0i 6.783+0i  182
>> 5: 2.086+0i 4.051+0i 1.159+0i  182
>> 6: 0.344+0i 0.033+0i 2.282+0i  182
>
> The data type is also ok:
>
>> > str(d)
>> Classes ‘data.table’ and 'data.frame':	128256 obs. of  4 variables:
>>  $ Fz  : cplx  0.002+0i 1.567+0i 0.314+0i ...
>>  $ Cz  : cplx  0.005+0i 2.263+0i 1.159+0i ...
>>  $ Pz  : cplx  0.054+0i 1.547+0i 3.841+0i ...
>>  $ item: int  182 182 182 182 182 182 182 182 182 182 ...
>>  - attr(*, ".internal.selfref")=<externalptr>
>
> When I just call the object, I don't get head and tail as usually but
> the following message:
>
>> > d
>> Error in rbindlist(allargs) : Unsupported column type 'complex'
>
> and when I want to set a key column for merging, I get:
>
>> > setkeyv(d, c("item"))
>> Error in setkeyv(d, c("item")) :
>>   don't know how to reorder type 'complex' of column 1. Please send 
>> this message to datatable-help
>
> So that's what I did. Am I doing something wrong here or is this just 
> a bug?
>
> Best,
> Paul
> _______________________________________________
> 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