Convert LHS := lapply(...) to a set(...) for loop internally?

Open
#4,225 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
r
Domain
data, performance

Research direction

Start by reading the linked discussion in #1441 and the examples involving lapply(.SD, ...) across hundreds or thousands of columns. Investigate how grouped assignment currently materializes lapply output and whether an internal set(...) loop is feasible without affecting speed. Done means a clear implementation direction and evidence about memory and performance trade-offs.

Written by the indexing model from the issue text.

Description

internals

Would this be possible/advisable even in grouping settings?

I have in mind doing lapply(.SD, ...) for .SD of 100s or 1000s of columns -- fundamentally, IINM, we have to store the output in memory first before assigning, so that the for loop approach would be much more memory-efficient.

Ideally it'd be done without any speed impact. Any considerations I'm missing?


another issue asks for that, also mentioning support for doing that by group, see #1441.

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.