Skip to content

by could accepted a named vector to set names when it's a character vector #1711

Closed

Description

@arunsrinivasan
require(data.table)
dt = data.table(x=c(1,1,2,2), y=1, z=2)

dt[, sum(y), by=.(xx = x)] # possible to name columns in by when using .()
dt[, sum(y), by=c(xx="x")] # could work as well

The same could be used for .SDcols as well in case of aggregations.. perhaps.

Activity

  1. added
    breaking-change
    on Sep 8, 2019
  2. ben-schwen commented on Nov 20, 2026

    @ben-schwen
    Member

    This was fixed in #4713 :)

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

    breaking-changefeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions