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"
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):From user3496254 SO: https://stackoverflow.com/questions/47228836/r-data-table-bug-cannot-rename-column-names-which-are-na