Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-Forge #5376] When DT is empty, DT[, newcol:=max(b), by=a] does not add the column #49

Closed
arunsrinivasan opened this issue Jun 8, 2014 · 0 comments
Assignees
Milestone

Comments

@arunsrinivasan
Copy link
Member

Submitted by: shubh bansal; Assigned to: Arun ; R-Forge link

In an empty data.table, defining a new column by reference by group does not add the column to the table.

In the example below, I would expect an empty column 'c' to be added to the data.table

dt1=data.table(a=character(0),b=numeric(0))
dt1
# Empty data.table (0 rows) of 2 cols: a,b
dt1[, c:=max(b), by='a']
dt1
# Empty data.table (0 rows) of 2 cols: a,b
@arunsrinivasan arunsrinivasan added this to the v1.9.4 milestone Jun 19, 2014
@arunsrinivasan arunsrinivasan self-assigned this Jun 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant