melt_: Make a 'Wide' data set 'Long'

Description Usage Arguments Details

View source: R/melt_.R

Description

Inspired by reshape2:::melt, we melt data.frames and matrixs. This function is built for speed.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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.


COMPASS documentation built on Nov. 8, 2020, 8:05 p.m.