Skip to content

Commit 12499cf

Browse files
committed
fix for empty column names
1 parent b25e6c0 commit 12499cf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

R/dataset.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ findAllColumnNamesInOptions <- function(options, allColumnNames) {
5151
preloadDataset <- function(datasetPathOrObject, options) {
5252

5353
dataset <- loadCorrectDataset(datasetPathOrObject)
54+
55+
# repair any names like "", which cause false positives in findAllColumnNamesAndTypes
56+
# because empty options are often ""
57+
cnms <- colnames(dataset)
58+
if (any(cnms == "")) {
59+
60+
bad <- which(cnms == "")
61+
newCnms <- make.names(cnms)
62+
cnms[bad] <- newCnms[bad]
63+
colnames(dataset) <- cnms
64+
65+
}
5466
# columns <- findAllColumnNamesInOptions(options, colnames(dataset))
5567
temp <- findAllColumnNamesAndTypes(options, colnames(dataset))
5668

0 commit comments

Comments
 (0)