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

Let setnames accept negative integers for the 'old' argument #1443

Closed
richierocks opened this issue Nov 26, 2015 · 0 comments
Closed

Let setnames accept negative integers for the 'old' argument #1443

richierocks opened this issue Nov 26, 2015 · 0 comments
Assignees
Milestone

Comments

@richierocks
Copy link

If I want to change all the column names except the first, for example, currently I have to do something like

DT <- data.table(x = 1:3, y = 4:6, z = 7:9)
setnames(DT, seq_along(DT)[-1], c("m", "n"))

It would be convenient if I could pass negative integers to old, in order to write

setnames(DT, -1, c("m", "n"))
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

2 participants