Skip to content

Commit cecfb0b

Browse files
Refactored duplicated logic in setDT and [,:=] to use a helper function
1 parent e12f726 commit cecfb0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/fmelt.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ melt.data.table = function(data, id.vars, measure.vars, variable.name = "variabl
184184
if (!is.data.table(data)) stopf("'data' must be a data.table")
185185

186186
# Validate id.vars
187-
if (any(is.na(id.vars) | id.vars == "")) {
187+
if (any(is.na(id.vars) | !nzchar(id.vars))) {
188188
stopf("One or more values in 'id.vars' is invalid.")
189189
}
190190

0 commit comments

Comments
 (0)