melt_ {COMPASS} | R Documentation

## Make a 'Wide' data set 'Long'

### Description

Inspired by `reshape2:::melt`, we melt `data.frame`s and `matrix`s. This function is built for speed.

### Usage

    melt_(data, ...)

    ## S3 method for class 'data.frame'
    melt_(data, id.vars, measure.vars,
      variable.name = "variable", ..., value.name = "value")

    ## S3 method for class 'matrix'
    melt_(data, ...)

### Arguments

`data` | The `data.frame` to melt.
`...` | Arguments passed to other methods.
`id.vars` | Vector of id variables. Can be integer (variable position) or string (variable name). If blank, we use all variables not in `measure.vars`.
`measure.vars` | Vector of measured variables. Can be integer (variable position) or string (variable name). If blank, we use all variables not in `id.vars`.
`variable.name` | Name of variable used to store measured variable names.
`value.name` | Name of variable used to store values.

### Details

If items to be stacked are not of the same internal type, they will be promoted in the order `logical` > `integer` > `numeric` > `character`.

[Package COMPASS version 1.18.1 Index]