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

@franknarf1 franknarf1 commented Nov 10, 2017

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

MichaelChirico added a commit that referenced this issue Nov 13, 2017
@mattdowle mattdowle added this to the v1.10.6 milestone Nov 13, 2017
@mattdowle

This comment has been minimized.

Copy link
Member

@mattdowle mattdowle commented Nov 13, 2017

Closed by #2477 thanks to @MichaelChirico

@mattdowle mattdowle closed this Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.