melt-array-e0: Melt an array

melt.arrayR Documentation

Melt an array

Description

This function melts a high-dimensional array into a form that you can use cast with.

Usage

## S3 method for class 'array'
melt(data, varnames = names(dimnames(data)), ...)

Arguments

data

array to melt

varnames

variable names to use in molten data.frame

...

other arguments ignored

Details

This code is conceptually similar to as.data.frame.table

Author(s)

Hadley Wickham <h.wickham@gmail.com>

Examples

a <- array(1:24, c(2,3,4))
melt(a)
melt(a, varnames=c("X","Y","Z"))
dimnames(a) <- lapply(dim(a), function(x) LETTERS[1:x])
melt(a)
melt(a, varnames=c("X","Y","Z"))
dimnames(a)[1] <- list(NULL)
melt(a)

reshape documentation built on April 12, 2022, 5:07 p.m.