Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tsp opened this issue Feb 15, 2023 · 1 comment · Fixed by #5631
Closed

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

tsp opened this issue Feb 15, 2023 · 1 comment · Fixed by #5631
Milestone

Comments

@tsp
Copy link

tsp commented Feb 15, 2023

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

@ben-schwen
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants