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
When the melt function is used on columns containing different data types it is raising the following warning message:
"Warning message:
In melt.data.table(water_AL, id.vars = "", variable.name = "") :
'measure.vars' [ ...] are not all of the same type. By order of hierarchy, the molten data value column will be of type 'character'. All measure variables not of type 'character' will be coerced too. Check DETAILS in ?melt.data.table for more on coercion."
This is for sure helpful when developing a data munging script. But in cases where I have noticed this warning and want this behaviour I wish to have an option to turn off this message.
This could be either implemented by explicitely defining the data type to which the coercion should be done, something like coerce.to="character" or by an option to mute only this message.
The text was updated successfully, but these errors were encountered:
Filed #5913 which is much more general but would at least partially address your request. I'm not immediately sure of the need for any new arguments -- I might prefer code that's more explicit about coercion for example:
The proposed coerce.to argument would not be sufficient in some cases with multiple types of corecion, such as below:
> melt(data.table(x1=1:2, x2=c(3,4), y1=c(T,F), y2=0:1), measure=measure(value.name, number, pattern="(.)(.)"))
numberxy<char><num><int>1:1112:1203:2304:241Messagesd'avis :1: Dans melt.data.table(data.table(x1 = 1:2, x2 = c(3, 4), y1 = c(T, :'measure.vars' [x1, x2] are not all of the same type. By order of hierarchy, the molten data value column will be of type 'double'. All measure variables not of type 'double' will be coerced too. Check DETAILS in ?melt.data.table for more on coercion.2: Dans melt.data.table(data.table(x1 = 1:2, x2 = c(3, 4), y1 = c(T, :'measure.vars' [y1, y2] are not all of the same type. By order of hierarchy, the molten data value column will be of type 'integer'. All measure variables not of type 'integer' will be coerced too. Check DETAILS in ?melt.data.table for more on coercion.
For that reason I think it is better to specify the type conversion explicitly, prior to calling melt.
This is a feature request:
When the melt function is used on columns containing different data types it is raising the following warning message:
"Warning message:
In melt.data.table(water_AL, id.vars = "", variable.name = "") :
'measure.vars' [ ...] are not all of the same type. By order of hierarchy, the molten data value column will be of type 'character'. All measure variables not of type 'character' will be coerced too. Check DETAILS in ?melt.data.table for more on coercion."
This is for sure helpful when developing a data munging script. But in cases where I have noticed this warning and want this behaviour I wish to have an option to turn off this message.
This could be either implemented by explicitely defining the data type to which the coercion should be done, something like coerce.to="character" or by an option to mute only this message.
The text was updated successfully, but these errors were encountered: