New symbol .KEY that refers to the key of data table

Open
#2,130 0 comments 3 reactions 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 reviewing data.table's existing handling of table keys and the by argument, then compare the requested behavior with the linked Stack Overflow question. Done means the example using .KEY groups by the data table key and produces the expected result.

Written by the indexing model from the issue text.

Description

feature request

It would be useful and more elegant (IMHO) to refer to the key of the data table with .KEY symbol:

x <- data.table(mtcars, key='cyl')
x[, .(mean=mean(mpg)), by=.KEY]

A StackOverflow questions where I asked about this is here: http://stackoverflow.com/questions/43589505/refering-to-the-key-of-data-table-in-by-argument-not-using-key

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.