Skip to content

Get rid of melt() warning message about type coercion in cases where coercion is wanted #5912

@MoREpro

Description

@MoREpro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions