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

setnames(x, new) fails if somehow anyNA(names(x)) #2475

Closed
franknarf1 opened this issue Nov 10, 2017 · 1 comment
Closed

setnames(x, new) fails if somehow anyNA(names(x)) #2475

franknarf1 opened this issue Nov 10, 2017 · 1 comment
Milestone

Comments

@franknarf1
Copy link
Contributor

The data.table interface to names don't seem to support making one NA, but if it does happen, it cannot be fixed with setnames(x, new):

x = setNames(data.frame(a = 1, b = 2), c(NA, "b"))

library(data.table)
setDT(x)
setnames(x, c("a", "b"))
names(x)
# [1] NA  "b"

From user3496254 SO: https://stackoverflow.com/questions/47228836/r-data-table-bug-cannot-rename-column-names-which-are-na

@mattdowle mattdowle added this to the v1.10.6 milestone Nov 13, 2017
@mattdowle
Copy link
Member

Closed by #2477 thanks to @MichaelChirico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants