Skip to content

Support for grouping/ordering/computing on columns of type complex #1444

@atalikami

Description

@atalikami

Hello,

The only question or information I can find on this is one I asked myself on stack overflow (http://stackoverflow.com/questions/32570742/r-data-table-package-and-complex-values) but it wasn't ever resolved.

The data.table package does not appear to support complex numbers, even though there was a specific bug fix addressing the problem, issue #982. I have updated to the latest development version, 1.9.7.

Now, I can have a data table which contains complex numbers, but nothing can then be done to it. For example:

stacktest<-data.table(x=complex(real=1:60, imaginary=-1:-60),y=LETTERS[1:10],z=rep(1:2,5))

This works, the data.table exists. However, if I try and use the setkey command:

setkey(stacktest, z)

Error in setkeyv(x, cols, verbose = verbose, physical = physical) : 
  Item 1 of list is type 'complex' which isn't yet supported

Or, if I try and run a function (any function as far as I can tell, I first discovered this trying to use dcast) on a subset of the data:

stacktest2<-stacktest[,.(abs(.SD)),by=.(y)]

Error in `[.data.table`(stacktest, , .(abs(.SD)), by = .(y)) : 
  Type 15 in .SD column 0

Being as issue #982 was specific to allowing complex numbers to work, I feel as though this is a bug, not a feature request.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions