melt.array | R Documentation |
This function melts a high-dimensional array into a form that you can use cast
with.
## S3 method for class 'array' melt(data, varnames = names(dimnames(data)), ...)
data |
array to melt |
varnames |
variable names to use in molten data.frame |
... |
other arguments ignored |
This code is conceptually similar to as.data.frame.table
Hadley Wickham <h.wickham@gmail.com>
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.