Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[bug] edge case: setnames shouldn't error on null data.tables when assigned character(0) #2452
Comments
|
Caused by this line:
I don't think I understand the comment? Can't this line just be expunged and that's that? |
|
I don't understand the comment and I think that line needn't exist, since the next line ensures that cols of data.table and the input character vector are identical. |
|
👍🏽 |
names(df) <- character(0)would work on a null data.frame. I think this should not error. The reason is that it avoids an unnecessaryif (ncol(dt))before to dosetnames(dt, nm)wherenmis the vector of names, which would becharacter(0)ifdthad no cols.Output of sessionInfo()