Skip to content

column type 'expression' not supported by data.table subset #5596

Description

@tsp

The example below produces the following error:
Error in [.data.table(data.table(a = 1, b = expression(1)), , b, by = a) :
Internal error: column type 'expression' not supported by data.table subset. All known types are supported so please report as bug.

# Minimal reproducible example
data.table(a=1,b=expression(1))[,b,by=a]

# Output of sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Danish_Denmark.utf8 LC_CTYPE=Danish_Denmark.utf8 LC_MONETARY=Danish_Denmark.utf8 LC_NUMERIC=C LC_TIME=Danish_Denmark.utf8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] data.table_1.14.6

loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2 rstudioapi_0.14

Activity

  1. ben-schwen commented on Apr 27, 2023

    @ben-schwen
    Member

    Ty for the hint. Actually, your example covers two cases:

    1. data.table is not able to subset expression columns
    2. group evaluation via dogroups does not work with expression columns
  2. added this to the 1.17.0 milestone on Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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