Skip to content

Master list: Feature completion for complex-valued columns #3690

@MichaelChirico

Description

@MichaelChirico

As a follow-up to #1444 and #3689, I think it's useful to keep a list of all the features missing for users who want to do work involving complex-valued columns z:

v1.12.4 NEWS contains :

image


Examples

DT = data.table(a = 1:5, z = 6:10 + (5:1)*1i)

1.

DT[order(z)]

Error in forderv(ans, cols, sort = TRUE, retGrp = FALSE, order = if (decreasing) -order else order, :
Column 1 of by= (1) is type 'complex', not yet supported. Please use the by= argument to specify columns with types that are supported. See NEWS item in v1.12.2 for more information.

2.

DT[ , .N, by = z]

Error in [.data.table(DT, , .N, by = z) :
column or expression 1 of 'by' or 'keyby' is type complex. Do not quote column names. Usage: DT[,sum(colC),by=list(colA,month(colB))]

3.

fwrite(DT)

Error in fwrite(DT) :
Column 2's type is 'complex' - not yet implemented in fwrite.

fread('a\n1+i')
#         a
#    <char>
# 1:    1+i

4.

DT[CJ(a, z)]

Error: Column 1 of by= (1) is type 'complex', not yet supported. Please use the by= argument to specify columns with types that are supported. See NEWS item in v1.12.2 for more information.

Coming from forderv so first this is a repeat of 1

DT[CJ(a, z, sorted = FALSE)]

Error: Type 'complex' not supported by CJ.

5.

DT[ , total := base::sum(z), by = .(a %% 2)]

DT[ , total := base::sum(z), by = .(a %% 2)]
Error in [.data.table(DT, , :=(total_rad, base::sum(z)), by = .(a%%2)) :
Internal error: writeNA passed a vector of type 'complex'

6.

DT[ , sum(z), by = .(a %% 2)]

Error in gsum(z) :
Type 'complex' not supported by GForce sum (gsum). Either add the prefix base::sum(.) or turn off GForce optimization using options(datatable.optimize=1)

7.

DT[DT, on = 'z']

Error in bmerge(i, x, leftcols, rightcols, roll, rollends, nomatch, mult, :
x.z is type complex which is not supported by data.table join

8.

DT[ , coalesce(`is.na<-`(z, 1), 0+0i)]

Error in coalesce(is.na<-(z, 1), 0 + (0+0i)) :
Unsupported type: complex

9.

DT[ , shift(z)]

Error in shift(z) : Unsupported type 'complex'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions