melt

0th

Percentile

Convert an object into a molten data frame.

This the generic melt function. See the following functions for the details about different data structures:

Keywords
manip
Usage
melt(data, ..., na.rm = FALSE, value.name = "value")
Arguments
data

Data set to melt

...

further arguments passed to or from other methods.

na.rm

Should NA values be removed from the data set? This will convert explicit missings to implicit missings.

value.name

name of variable used to store values

Details

See Also

cast

Aliases
  • melt
Documentation reproduced from package reshape2, version 1.4.3, License: MIT + file LICENSE

Community examples

jestonblu@gmail.com at Oct 19, 2017 reshape2 v1.4.2

##### Melt Example ```r library(reshape2) # example data frame x = data.frame( id = c(1, 1, 2, 2), blue = c(1, 0, 1, 0), red = c(0, 1, 0, 1) ) # collapse the data frame melt(data = x, id.vars = "id", measure.vars = c("blue", "red")) ```