Support setDT(L[[c(1, 2, 3)]]

Open
#7,096 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start by reproducing the nested-list example with setDT(L[[1:3]]) and inspect the setDT path that reaches setlistelt. Confirm the intended behavior from the shown L[[c(1:3)]] result, then verify that the call completes without the internal error and produces the expected data.table.

Written by the indexing model from the issue text.

Description

consistency

We could eliminate this cruft by just supporting such case, I don't imagine it would be that hard? (famous last words)

Originally posted by @MichaelChirico in https://github.com/Rdatatable/data.table/pull/7064#discussion_r2164852205

L = list(list(NULL, list(NULL, NULL, data.frame(a = 1))))
L[[c(1:3)]]
#   a
# 1 1
setDT(L[[1:3]])
# Error in setDT(L[[1:3]]) : 
#   Internal error in setlistelt: Second argument to setlistelt must a length 1 integer vector. Please report to the data.table issues tracker.
Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.