Implement DT[, across(.SD, fun1, fun2, fun3), by=group]

Open
#4,970 14 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start by reading the dplyr::across reference and the linked DataFrames.jl discussion, then search the data.table codebase for grouped expressions and .SD handling. The issue names no files or tests; done means agreeing on and implementing the proposed across(.SD, min, max) behavior for grouped data.table expressions, with coverage for the shown example.

Written by the indexing model from the issue text.

Description

feature request top request

Inspired by dplyr::across and triggered by https://github.com/JuliaData/DataFrames.jl/pull/2725#discussion_r622424355

Instead of :

DT[, unlist(lapply(.SD, function(x) c(max=max(x), min=min(x)))), by=group]

it could be

DT[, across(.SD, min, max), by=group]

I didn't find any related issues or PRs in a quick search. If there are any, and S.O. questions, please link them here.

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.