You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (is.list(measure.vars)) {
if (length(value.name) == 1L)
value.name = paste(value.name, seq_along(measure.vars),
sep = "")
}
As @arunsrinivasan mentioned in an SO chat, it could be solved by replacing is.list(measure.vars) with is.list(measure.vars) && length(measure.vars) > 1L).
The text was updated successfully, but these errors were encountered:
jaapwalhout
changed the title
melt add number to value.name when using patterns
melt adds a number to value.name when using patterns
Sep 21, 2015
When using the
patterns
argument with one value column inmelt
a number (1) is added to the value name. A reproducible example:The following two
melt
operation should give the same output (but don't):The output of
names
:I expected that
rnk1
would have the same names asrnk2
The cause of this behavior is from this part of the
melt
function:As @arunsrinivasan mentioned in an SO chat, it could be solved by replacing
is.list(measure.vars)
withis.list(measure.vars) && length(measure.vars) > 1L)
.The text was updated successfully, but these errors were encountered: